Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload file with status feedback #190

Open
johansmitsnl opened this issue Nov 6, 2024 · 1 comment
Open

upload file with status feedback #190

johansmitsnl opened this issue Nov 6, 2024 · 1 comment

Comments

@johansmitsnl
Copy link

Uploading files on a client side application is often used. It would be nice to have a helper that provides details on the upload to show progress and state.

The function should accept:

  • url
  • method (POST/PUT/...).

The signals it could return are:

  • State (waiting, uploading(x bytes, total bytes), done)
  • Trigger/Start the upload, you may want to queue the upload
  • Cancel/abort the upload
  • Optional callback with the state where you want to manage some other state when the state changes
@maccesch
Copy link
Contributor

maccesch commented Dec 5, 2024

@johansmitsnl

After doing a bit of research I think this function could take an arbitrary FormData as input to upload. That way a user could easily upload one or multiple files together with extra data, or even just data without files.

The FormData could be a wrapper around web_sys::FormData to allow for better UX with rust types like byte arrays etc.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants