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

Return upload progress for fileupload #17

Closed
MaxSchilling opened this issue May 25, 2021 · 6 comments
Closed

Return upload progress for fileupload #17

MaxSchilling opened this issue May 25, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@MaxSchilling
Copy link

It would be great to have a callback to retrieve the upload progress of a file, to show it back to users. Firebase offered a subscription method to the upload progress, which was very helpful and user friendly.

Thanks!

@shyndman shyndman added the enhancement New feature or request label May 25, 2021
@shyndman
Copy link
Contributor

shyndman commented May 25, 2021

This would definitely be a useful feature.

For a bit of background, we made the decision to use the http library for two reasons:

  1. It's the same library used by graphql, meaning smaller binaries, and a smaller debugging surface
  2. It has first-class support for multipart HTTP requests, unlike the library in dart:io

But, unfortunately, the http library does not (directly) support upload progress (dart-lang/http#465).

That said, I'm sure this is possible with a some effort. I'm going to do some research and see what comes up.

@shyndman
Copy link
Contributor

shyndman commented May 25, 2021

OK, I've looked into how this is implemented elsewhere, and replicating their approach is definitely possible.

It's unclear to me whether the approach I'm seeing in other libraries is right exactly, as they appear to be measuring the progress of data being written to the socket's buffer, and not the network.

But I think I see the piece they're missing. Definitely needs a bit of experimentation, but I think this can be done.

@shyndman
Copy link
Contributor

@MaxSchilling, out of interest, can you provide me a rough estimate of the size of file your customers would be uploading?

@MaxSchilling
Copy link
Author

We are uploading medium compressed videos, so roughly 3-10MB, maybe up to 20/50? But not more I think

@MaxSchilling
Copy link
Author

Thanks for the research and the support! Not super urgent, but I think a nice convenient feature any way

@shyndman
Copy link
Contributor

shyndman commented Feb 3, 2022

This has been in the stable release builds for a couple weeks now.

@shyndman shyndman closed this as completed Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants