|Subject:||Re: Support resume downloads?|
|Posted by:||Remy Lebeau (TeamB) (firstname.lastname@example.org)|
|Date:||Wed, 27 Jul 2005|
"Nicholas Fauchelle" <ni…@hyper.net.nz> wrote in message
> 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.
Support resume downloads? posted by Nicholas Fauchelle on Wed, 27 Jul 2005