Comments (4)
Please have a look at issue #2.
Basically you need to access the AlreadyDownloadedRanges
property of the MultiPartDownload
object you are using. You can for example serialize this to a file when closing your application. On Restart just deserialize it and provide it to the constructor of MultiPartDownload
.
from downloader.
I already saw issue #2
I suspected that it can be done by serialization and deserialization,
Sadly there are unexpected behaviors which may prevent you using such method by users like unexpected shutdown, so your serialized object does not fit with file content if i am right.
It would be good to use AddRange
but i believe it does not really fit with your multi-part concept.
I previously used java based app (JDownloader) which was capable to resume multi-part downloading after restarting app.
from downloader.
I'm not quite sure if I understand your point correctly, but I think events like sudden shutdown could be handled by not only saving the state of a download when stopping it gracefully, but also saving it from time to time. It's also no problem if the saved state is a bit older than the already downloaded file, as the resumed download would only overwrite some already downloaded parts which causes not trouble.
If you really want to be sure that the download on the disk is matching the state of the already downloaded parts, you could write your own version of DownloadToFileSaver
, which stores the state to a file placed beside the target file as soon as DataReceived
is called. Drawback of this solution would be additional disk throughput, so you may have to throttle the writes of the state to disk.
from downloader.
You are right, i missed that already downloaded parts will be overwritten.
I properly deserialized AlreadyDownloadedRanges
to file and serialized it back, so it resumed much faster than by AddRange
request.
Thank you for this suggestion.
from downloader.
Related Issues (20)
- WebForm can not trigger the registered event HOT 2
- More instances of Downloader HOT 3
- Where should I catch the exception? HOT 1
- Large files downloading issue #2 HOT 4
- this software can user for product ? HOT 1
- Cannot find nuget package HOT 2
- Ftp Downloader is not closing connection to server
- Large files downloading issue HOT 1
- Large files downloading issue HOT 1
- Help! Content-Length is missing or -1, but transfer encoding is set to chunked HOT 1
- Some download url (such as: github zip) will not get response HOT 5
- Slowing down in big files HOT 5
- NullReferenceException in MultiPartDownload.cs HOT 4
- Wrong Exception for non existing URL
- Large files downloading issue
- Remaining time HOT 3
- Download speed limiting HOT 2
- Download speed calculation intervals HOT 1
- -
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from downloader.