2

I have seen download managers manage to resume HTTP downloads from where they stopped. How are they able to resume downloads? Is it related to the Accept-Range Header? Or are there other mechanisms that download managers use to identify how much of the file has been downloaded and how much is left to be downloaded?

Doc Brown
219k35 gold badges405 silver badges619 bronze badges
asked Oct 29, 2021 at 6:22
4
  • Hi :) welcome to SE.SE :) i think your question is a much better fit for stackoverflow, though Commented Oct 29, 2021 at 7:15
  • @marstato they'll probably call it too vague on StackOverflow though. Pretty sure they usually want one specific question with one specific answer on there. Commented Oct 29, 2021 at 7:23
  • I’m voting to close this question because it has nothing to do with software engineering. Commented Oct 29, 2021 at 8:14
  • 2
    @Philipp: arguably, this can be seen as an algorithmic question, and algorithmic questions are definitely on-topic on this site. Of course, most questions of the type "how does XYZ type software work" are too broad for this site. However, I think in this case, it is unlikely there are a lot of different approaches for resuming a download - let me try to reword the question a bit. Commented Oct 29, 2021 at 9:24

1 Answer 1

6

For tracking the progress: the response to the first download request will have a Content-Length header telling the download manager how big the entire file is. That info will be persisted (and obviously shown in the UI).
Finding out How much has been downloaded is a simple matter of asking the OS how big the local file is.

On pause/resume: Yes, this is done with the Range request header. I don't know how many servers that support the request-header advertise that support with the Accept-Ranges response-header. If you resume a download from a server that does not support the Range header, download managers will typically download the content again, possibly not writing the bytes to disk that they already have (because that avoids unnecessary load on the disk).

answered Oct 29, 2021 at 7:46

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.