Le 09/01/2011 15:49, Arno Garrels a écrit :
Jean-Paul Passama wrote:

I'm trying to have a progress bar working during a file download by
HttpClient.Get (and HttpClient.RcvdStream).

I've seen the OnDocData that seems to receive the length of data
downloaded. Unfortunaly, the data length isn't really the size of the
piece of file downloaded because the packed received include the HTTP
protocol and the data.

Is a way to know :
- the size of the entire file (before starting the download)
Quoted from http://www.rfc-editor.org/rfc/rfc2068.txt:
"An HTTP/1.1 server may also establish persistent connections with
HTTP/1.0 clients upon receipt of a Keep-Alive connection token.
However, a persistent connection with an HTTP/1.0 client cannot make
use of the chunked transfer-coding, and therefore MUST use a
Content-Length for marking the ending boundary of each message."

So it should be possible to force the server to send a content-length
header. In event OnDocBegin property ContentLength should return that

In the Event OnDocBegin , no such property (ContentLength) :

procedure TMyForm.HttpCli1DocBegin(Sender: TObject);

And THttpClient doesn't have this property.

So where I could retrieve this property from ?

Thank you

To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to