Re: Support resume downloads?

Giganews Newsgroups
Subject: Re: Support resume downloads?
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Wed, 27 Jul 2005

"Nicholas Fauchelle" <ni…@hyper.net.nz> wrote in message
news:7D59C68E18D4E240ni…@hyper.net.nz...

> I have been trying to get idHttp to resume downloads if the download
> got broken or paused (shown below), however it's not working as
> expected. I upgraded to Indy10 but still not working right.

That is because you are not using it properly to begin with.

>  IdHTTP1.Request.ContentRangeStart := MyStream.Size;

That is completely wrong.  The ContentRangeStart property only applies to
SERVERS only, not CLIENTS.  In fact, in the latest snapshot, the property no
longer exists for a client.  You should be using the Range property instead:

    IdHTTP1.Request.Range = IntToStr(MyStream.Size) + '-';

Also, make sure the ProtocolVersion is set to pv1_1, since HTTP v1.0 does
not support resuming at all.  You can use the 'Accept-Ranges' header in the
response to the original download as a hint to whether the server supports
resuming, though a server is not required to send that header at all.

Gambit

Replies

None

In response to

Support resume downloads? posted by Nicholas Fauchelle on Wed, 27 Jul 2005