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

[Feature Request] Resume upload from last uploaded chunk after page reload or when resuming download from a different client. #21

Open
motion-x86 opened this issue May 18, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@motion-x86
Copy link

motion-x86 commented May 18, 2020

This will allow downloads to resume after a page reload or different client.

@mmcc
Copy link
Contributor

mmcc commented May 26, 2020

Hm I really like this idea, but I'm struggling a bit with where this line should be for the library itself. How would you feel about us exposing the tools to be able to build this yourself? My first thought is we expose more details about the "chunk mapping" for lack of a better phrase, then make sure to include more details about which chunks were successfully completed via events. From there we'd just need a way of configuring which chunk to start at when initializing the upload.

Thoughts?

@motion-x86
Copy link
Author

motion-x86 commented May 27, 2020

I think that sounds about right, we already have the attempt and attemptFailure events which allow us to store the index of the last successful chunk upload.
What I did is simply add this line to the UpChunk constructor:

this.chunkCount = options.beginAtChunk || 0; and IOptions beginAtChunk ?: number;

With that in place I was able to resume a download from the last uploaded chunk successfully.

@mmcc mmcc added the enhancement New feature or request label Aug 17, 2020
@MartinMalinda
Copy link

@motion-x86

Thanks for the issue, it got me thinking. For the file upload to resume from last location the user has to select the same file I assume.

How do you handle this? Do you also store file name in the localStorage and do a check for that?

And I guess BE (Mux or other) also cleans up unfinished uploads after some time, so there needs to be a check for that also.

@hfossli-agens
Copy link

Any progress on this from @mmcc / mux? :)

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

4 participants