views:

373

answers:

3

I want to write a C++ program to download files with HTTP. For the sake of learning I would like to implement multipart downloading in my program the way DownThemAll! does. It is not possible to do lseek on a linux socket. I suppose it would be some HTTP option that we would need to specify, telling where to start downloading the file from. Thus we could have multiple connections open to the server. Is it right? What are the HTTP headers for doing so?

+1  A: 

I suggest you take a look at section 14.35.1 Byte Ranges of the HTTP spec:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35

gahooa
A: 

You need the Range HTTP header.

Douglas Leeder
+4  A: 

There is a library based on C++ and ASIO called Urdl.

ASIO link: http://asio.sourceforge.net

Urdl link: http://think-async.com/Urdl/doc/html/index.html

Beh Tou Cheh