News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Downloader

Started by liquidsilver, January 29, 2006, 07:50:13 PM

Previous topic - Next topic

liquidsilver

I would like to create a downloader. I know this is easy, but I want to be able to pause/resume downloads, and I don't know the protocol involved. The basic reasoning behind this is that I want to be able to download my files at home and then continue at school, taking the progress with me. I don't mind reading technical documentation if that's all you have.

Vortex

Have a look at Iczelion's HTTP Downloader v1.5 :

QuoteShow how to write a simple winsock program that uses HTTP to download files. This version can resume broken download.

http://spiff.tripnet.se/~iczelion/files/http15.zip

liquidsilver

Awesome. I'll download it and try at home. Thanx

Tedd

http://www.ietf.org/rfc/rfc2616.txt gives the full scary details of HTTP. Though you can get away with not implementing most of it (i.e. it will work, even if it breaks every now and again.)
Once you've got a basic file-downloader working, to get 'resume' functionality, you'll want to include a Range specifier which asks for a specific chunk of the file (start offset, end offset.) It does require that the server you download from supports it (they don't have to) but you can expect that most will.
No snowflake in an avalanche feels responsible.

Shantanu Gadgil

To liquidsilver,
the downloaded is VERY VERY SPECIFIC, completeley hard-coded. Beware !!! ;). I guess it is supposed to be :)

This was the one which helped me in understanding how to download from HTTP using Winsock, though it was not exactly fun.

Processing the WM_SOCKET message method is just one of the methods. I found it very difficult to keep using the same strategy if I were to download in multi-parts. (for a single thread...it is OK).

Things which helped me (other than this VERY GOOD sample) was HTTP RFC (GET and HEAD in particular)

Write some good string parsers for understanding the different values of the header response for the HTTP.

To ret is human, to jmp divine!

arafel

liquidsilver,

Before starting, consider using WM_SOCKET alternatives. It may help you to avoid some headaches later when you decide to do some multithreaded stuff. like multiple simultaneous download for example.

You may also want to get an utility for viewing HTTP traffic. Such as Madwizard`s WinSock hook debug tool (http://www.madwizard.org/view.php?page=downloads). It helped me a alot to understand HTTP protocol and debug my apps.

Also check download manager I have put together (at my site). It's rather unfinished, but maybe you'll find something useful in it.

liquidsilver

Quoteyou'll want to include a Range specifier which asks for a specific chunk of the file (start offset, end offset.)

That's what I needed, thanx.