Skip to content

Instantly share code, notes, and snippets.

@mturoci
Created September 6, 2022 16:22
Show Gist options
  • Save mturoci/b371b6621073ff0be999213c31b05bc2 to your computer and use it in GitHub Desktop.
Save mturoci/b371b6621073ff0be999213c31b05bc2 to your computer and use it in GitHub Desktop.
from h2o_wave import main, app, Q, ui
@app('/')
async def serve(q: Q):
# Use app scope to make sure the file is uploaded only once.
if not q.app.initialized:
# Upload the file to the Wave server.
download_path, = await q.site.upload(['dataset.csv'])
q.app.initialized = True
# TODO: Draw a UI to allow file downloads.
await q.page.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment