ui.upload frontend component #3862
PeterMarkuson
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
recently I am trying to develop own components for my project. I wanted to have a simpler and smaller ui.upload panel. Basically it should just be a button with a counter. It should allow to upload several files by clicking it more than once and it should allow to save data into memory for further processing before saving to disk. Also, I just wanted to have ONE uploader in my project, so with this component I can still choose to show the original ui.upload or my button solution.
This is my code so far:
And it is used as easy as
where
self.after_upload_attachment
is my callback to process the upload. You can easily modify all used niceGUI components like the badge, button or the original upload panel (like in this example I set the badge text).It shows up like this (screenshot from my app):
On mobile devices (tested on Android) it will allow the user to pick either the camera app or voice recorder app or file picker to provide the data. On Windows it will start the file picker.
BR/Peter
Beta Was this translation helpful? Give feedback.
All reactions