tauri-apps / tauri-apps/plugins-workspace
[upload] Add ability to pause and resume download task
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
I need the ability to pause and resume downloading files.
## Technical Research
As, per my research. `download resume` is not supported by every url, the link has to return `Accept-Ranges: bytes` as header to be able to pause and resume downloads.
**How it will actually works**:
- A download task will be created.
- And the file is downloaded 10mb/100mb and then it is paused.
- Whenever the download is resumed, a GET request will be made
with the headers `Range: bytes=1048576-104857600`, this will only give the response from the 10th mb.
. and we start appending the data to the file.
**For this feature, we need to**:
- Create and persist download tasks ( So, that they can be resumed or paused in any point in time )
- We need to store `accumulatedProgress` and whenever the, user resumes the file download, the download will start from the accmulatedProgress as a checkpoint.
This is going to be a major feature, and the API design and download task management, is still a topic of discussion..
Contributor guide
Assessment
This issue has not been assessed yet.