Replies: 1 comment
-
Hi @pimswr, NiceGUI uses the "url" prop internally to register its own upload endpoint. If you change the "url" prop, NiceGUI doesn't receive any upload and, thus, does not call the upload handler. But you can try to use the generic event registration for QUploader's "uploaded" event: def handle_upload(e: events.GenericEventArguments):
print(f'Uploaded {e.args}')
ui.notify(f'Uploaded {e.args}')
@app.post('/upload')
def upload():
print('POST /upload')
return {'success': True}
ui.upload().classes('max-w-full').props('url=/upload').on('uploaded', handle_upload) Note that the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have developed an web uploader with quasar, which I am trying to port to nicegui. The frontend sends the files to an uploader server im backend based on formidable. After a successful upload, the frontend triggers an API to checkin the uploaded files in a thirdparty system.
I have the problem with the nicegui port, that it does not get the event notifiying the upload's end. I can reproduce it with the following minimal code:
Without the url property, I get the event and the code goes through handle_upload(). With it not.
Do you see a possibility to make it work ?
Many thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions