Skip to content

Commit

Permalink
docs(fileUpload): add validation example
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Oct 26, 2022
1 parent 662c5cb commit 9c81ea9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/validation/core/27_file_upload.py
@@ -0,0 +1,23 @@
from trame.app import get_server
from trame.ui.vuetify import SinglePageWithDrawerLayout
from trame.widgets import vuetify
from trame.app.file_upload import ClientFile


server = get_server()

with SinglePageWithDrawerLayout(server) as layout:
with layout.toolbar:
vuetify.VFileInput(
v_model=("file_exchange", None),
)


@server.state.change("file_exchange")
def handle(file_exchange, **kwargs):
file = ClientFile(file_exchange)
print(file.info)


if __name__ == "__main__":
server.start()

0 comments on commit 9c81ea9

Please sign in to comment.