0

I am creating a downloadaccelerator library Is there any way to know before starting a download from a link weather the server supports resuming downloads/downloading file reange . Because if it does then i ll use multipple connections and download ranges or else i ll download the whole file normally

thank you

Steve Moretz
  • 2,758
  • 1
  • 17
  • 31
Rahul Verma
  • 2,140
  • 3
  • 21
  • 31

1 Answers1

1

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 http://www.wgz.org/chromatic/perl/IntroTestMore.pdf

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-Peer: 167.168.132.148:8080
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

More info here: http://www.crazyengineers.com/community/threads/how-does-resume-download-work.7396/

Jorge Fuentes González
  • 11,568
  • 4
  • 44
  • 64
  • Can you please provide some code for implementing thr HEAD command . – Rahul Verma Sep 06 '12 at 21:35
  • Depending of what language/function are you going to use there are different implementations. It's easy to find, try google: https://www.google.es/?q=sending+HEAD+request but I tell you, it's just the same as sending a GET request, the only thing is that you need to change GET for HEAD. – Jorge Fuentes González Sep 06 '12 at 21:44