CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@Kaustubh Katdare • 31 Oct, 2008
I've had my experience of losing about 600 mb of ubuntu .iso file while downloading from the Internet. So I'm now thinking can anyone explain how the 'resume download' works?

What I want to know is this -

1. How does server/client software keep track of bytes transferred. I've noted that the server must also support 'resume download' functionality.

2. How does the download resumes exactly the place where the download was paused [​IMG].

I think not many have ever cared to know how it works.
@parihar888 • 31 Oct, 2008 hi big k

while sending any msg or any data like resume at both end of server / client
the is a role play of parity bit in the header if both the bits received at the end are same then downloading is OK ,.,.
@sriramchandrk • 03 Nov, 2008 1. Let me start with how download manager gets to know the size of the requesed file and if server supports resume download.

Similar to GET header to get the required html page, we have something called as HEAD header.

When you send a HEAD request for an URL we get a set of values for the URL

Example: if you want to know details of

Send a head command to the URL
the response will be
Date: Mon, 03 Nov 2008 06:29:09 GMT
Accept-Ranges: bytes
ETag: "156046f-11889-3a578cd2bf2c0"
Server: Apache
Content-Length: 71817
Content-Type: application/pdf
Last-Modified: Thu, 11 Jul 2002 04:53:07 GMT
Client-Date: Mon, 03 Nov 2008 06:29:10 GMT
Client-Response-Num: 1
Intresting Values:Accept-Ranges, Content-Length

Accept-Ranges: bytes 'tells that server is ready to give files part by part as requested!'

If this doesn't appear then most probably the server will not allow resume download.

This tells the size of the pdf file. Useful to find how much is still left to download while resuming. (infact from which byte we need to download.

2. Now since download manager knows that this server supports download by parts(resuming as well).

Explaining Steps done by Download manager(for only one split):
1. Connects to on port 80(where ever http is running) using a tcp connection.
2. Sends following text.

GET /chromatic/perl/IntroTestMore.pdf\n\n
3. The server starts sending some headers followed with file contents.
4. If you stop the download though the interface given the
- download manager disconnects the connectino
- prepares the temp file for the file downloaded (partly) and also keeps a track for how much got downloaded for example let it be 10000 bytes.

Now when you click on resume download the download manager does:
Step 1. same as above
2. Sends the following text
GET /chromatic/perl/IntroTestMore.pdf\n
RANGE: bytes-unit = 10001\n\n
here bytes-unit specifies from which byte the files is required.
There are called range byte headers.

3. The server starts sending some headers followed with file contents(starting from 10001 byte instead of from beginning of file!).
4. Download manager starts appending the bytes recieved to previous temp
5. Once total file is downloaded the DM changes the temp file to actual file name which could be used (file is now usable).

You can see http rfc for more details.

Now you could think how the splits work.
Actuall each download manager thread downloads part of file by specifying ranges and once everyone is done they join all the splits to give a complete file.
Thanks & Regards

Related Posts

@Kaustubh Katdare · Jan 6, 2017

I decided to give the new UPI payments system built by the Government to find out how it works. I was asked to create a UPI ID for myself so...

@Shyamsundar · Dec 21, 2012

How to calculate percentage ripple voltage value? for output of 9.6V,1A

@anshulkumar1234 · Jan 14, 2008

can any one plz write to me the significance of "back emf" in came of d.c. motors....plz write to me at " " .... plzz do reply soonnnnnn

@andenagaveni24 · Feb 25, 2012

do give guidelines how can i prepare a good ppt for technical seminar presentation..can anybody upload a sample ppt presentation here....

@Ankita Katdare · May 5, 2014

A research team at UCLA has been successful in developing a new device and its manufacturing process that can bring about enhanced quality of images in the displays used in...