Skip to main content

Uploads / UI

Accept files from the user.

import os
from h2o_wave import main, app, Q, ui
import os.path

def make_link_list(links):
# Make a markdown list of links.
return '\n'.join([f'- [{os.path.basename(link)}]({link})' for link in links])

async def serve(q: Q):
if q.args.user_files:['example'].items = [
ui.text_xl('Files uploaded!'),
ui.button(name='back', label='Back', primary=True),
else:['example'] = ui.form_card(box='1 1 4 7', items=[
ui.text_xl('Upload some files'),
ui.file_upload(name='user_files', label='Upload', multiple=True),

Tags:  formupload