Open motion-x86 opened 4 years ago
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?
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.
@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.
Any progress on this from @mmcc / mux? :)
This will allow downloads to resume after a page reload or different client.