Giter VIP home page Giter VIP logo

Comments (3)

bezzad avatar bezzad commented on August 23, 2024 1

Hi everybody,
First, make sure you set false to the ClearPackageOnCompletionWithFailure option. Because, this option tells the Downloader to clear the package and downloaded data when the download is completed with failure, but the default value is false.

Second, before downloading, keep the downloadService.Package in a variable;

// At first, keep and store the Package file to resume 
// your download from the last download position:
DownloadPackage pack = downloader.Package;

after downloading, you can stop or pause a download or the download may be completed with an error. Therefore, when you want to resume downloading at last point, just pass the package to the downloader like this:

await downloader.DownloadFileTaskAsync(pack);

Note: Sometimes a server does not support downloading in a specific range. That time, we can't resume downloads after canceling. So, the downloader starts from the beginning.

from downloader.

akprogram avatar akprogram commented on August 23, 2024

In the name of GOD.
I have same as this problem. I checked DownloadService.cs codes and i knew, this class delete uncompleted download file, before start (resume) download, then continue, but i got errors for delete, so I close my project without resume.
if everybody find solution please help me.
tank you viewers and bezzad.
ممنونیم بهزاد. کاملش کل. عالیه

from downloader.

Phantom-KNA avatar Phantom-KNA commented on August 23, 2024

Additional info for saved your Packed, you can use json file for this:

public void SavedPacked(DownloadPackage packet, string rutaArchivo) { string json = JsonConvert.SerializeObject(packet); File.WriteAllText(rutaArchivo, json); }

public DownloadPackage ReadPacked(string rutaArchivo) { string json = File.ReadAllText(rutaArchivo); return JsonConvert.DeserializeObject<DownloadPackage>(json); }

if (File.Exists("your path .json file")) { var packed = LeerPacked("your path .json file"); Console.WriteLine("!---- OnResume ----!"); downloader.DownloadFileTaskAsync(packed); } else { Console.WriteLine("!---- OnStart ----!"); downloader.DownloadFileTaskAsync("url file to download", " your file name"); }

Use SavePacked in dDownloadProgressChanged

from downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.