How can a file be used instead of a url in the header image? #2190
Answered
by
mturoci
gbethardy-h2oai
asked this question in
Q&A
-
How can a file be used instead of a url in the header image? |
Beta Was this translation helpful? Give feedback.
Answered by
mturoci
Nov 9, 2023
Replies: 1 comment
-
Hi @gbethardy-h2oai. You can also manually upload the image to the server and use that: from h2o_wave import Q, ui, main, app
@app('/')
async def serve(q: Q):
q.app.img, = await q.site.upload(['img.png'])
q.page['header'] = ui.header_card(
box='1 1 -1 1',
title='My app',
subtitle='Let\'s get started!',
image=q.app.img
)
await q.page.save() See docs for more info. However, a better option is to usually go for public dir option and use its URL then. See https://wave.h2o.ai/docs/configuration/#configuring-the-server |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gbethardy-h2oai
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @gbethardy-h2oai.
You can also manually upload the image to the server and use that:
See docs for more info.
However, a better option is to usually go for public dir option and use its URL then. See
https://wave.h2o.ai/docs/configuration/#configuring-the-server
https://wave.h2o.ai/docs/configuration/#publicprivate-dirs
https://wave.h2o.ai/docs/files/#serving-files-directly-from-the-wave-…