-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
How we can cancel or pause downloading files using dio? #399
Comments
Now from anywhere just, As for pause/resume support, better wait for @wendux. EDIT: Actually, pause/resume also works, but you have to supply the header |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions. |
Have you found a solution? |
How we can Pause and continue downloading where we stopped exactly? |
yes
…On Tue, Aug 4, 2020 at 11:58 AM Deepashree ***@***.***> wrote:
How we can Pause and continue downloading where we stopped exactly?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#399 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG42GYF4FGMRWJGVTITZHDLR66TBZANCNFSM4II2RAXQ>
.
|
+1 |
Edited my original comment. |
Can you explain in a bit more detail for noobs like me? Thanks |
@krypticallusion
Actually, pause/resume also works, but you have to supply the header range:1222-19238, then append the files. Can you give a simple example? What do you mean by append the files? |
I can't right now give you the exact working sample, sorry. Z = "The File to be downloaded" Once you cancel() a download, You should have the file that dio wrote to. Issue another download with the range supplied. Suppose you paused the download at 1MB out of 14Mb so (1048576). |
https://github.com/flutterchina/dio/blob/develop/example/lib/download_with_trunks.dart refer this for merging. |
Why doesn't the package offer the possibility to use FileMode.append instead of FileMode.write instead of downloading chunks and then merging them? dio/dio/lib/src/dio/dio_for_native.dart Line 89 in 7cfadc4
|
Beats the point, you can't have parallel file writes at the same point in time at different file locations. That's simply not possible. That's why we create some temporary files that can be parallel-ly written to, then stitch them back together. Hope this helps. |
any solution guys ? for pause and resume ? |
@Khushnu, |
New Issue Checklist
Issue Info
Issue Description and Steps
Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.
The text was updated successfully, but these errors were encountered: