Closed NeekoDev closed 1 year ago
Hi @NeekoGta , You must do the following steps to cancel and resume a file.
var downloadOpt = new DownloadConfiguration();
var downloader = new DownloadService(downloadOpt);
// download your file
await downloader.DownloadFileTaskAsync(url, file);
// At first, keep and store the Package file to resume
// your download from the last download position:
DownloadPackage pack = downloader.Package;
// then call this function to break your stream and cancel progress.
downloader.CancelAsync();
// store your package file in a file or database
// resume download with package
await downloader.DownloadFileTaskAsync(pack);
If these steps are OK, but you have the issue again. Please attach your "download config" and "download URL" here. I'll check your URL and tell you what's the problem.
Note: Some servers can't resume downloading because they don't accept downloads in a range. So, the Downloer also can't request to resume downloading from special bytes.
Hi,
I'im trying to resume download of large file after exit/restart program. But values of DownloadProgressChangedEventArgs seems incorrect.
I think I forgot a step? I followed it though : https://github.com/bezzad/Downloader/blob/master/src/Downloader.Test/IntegrationTests/DownloadIntegrationTest.cs#L122
Do I miss something?
Thanks ! :)