download button
#1253
Replies: 3 comments 7 replies
-
You can use |
Beta Was this translation helpful? Give feedback.
2 replies
-
You could maybe just redirect users when they click the button like so: from h2o_wave import main, app, Q, ui
@app('/')
async def serve(q: Q):
if not q.app.initialized:
(q.app.data_link,) = await q.site.upload(["./data.csv"])
q.page["meta"] = ui.meta_card(box="")
q.page["form"] = ui.form_card(
box="4 1 4 4",
items=[
ui.button(name="download_data", label="Download Data", primary=True),
ui.link(label="Download Data", path=q.app.data_link, download=True, button=True)
]
)
q.app.initialized = True
elif q.args.download_data:
q.page["meta"].script = ui.inline_script(f"""
window.open("{q.app.data_link}", "_blank");
""")
await q.page.save() |
Beta Was this translation helpful? Give feedback.
2 replies
-
I believe with the latest version, this maybe possible with setting |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
is it possible to add a primary button that downloads something, or, takes a path (https url) for a downloadable pdf?
trying to replicate something like this (Solution Brief Download button):
https://www.h2o.ai/partner-network/find-a-partner/snowflake/
Beta Was this translation helpful? Give feedback.
All reactions