Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Mar : Re: Wininet.dll & HTTPQueryInfo

www.cryer.info
Managed Newsgroup Archive

Re: Wininet.dll & HTTPQueryInfo

Subject:Re: Wininet.dll & HTTPQueryInfo
Posted by:"MikeR" (nf4lnospam@pobox.com)
Date:Fri, 9 Mar 2007 16:08:45

Remy Lebeau (TeamB) wrote:
> Then the server is not sending a "Content-Length" header.  Without
> seeing the actual HTTP traffic, my guess would be that a chunked
> transfer is occuring.  In other words, the "Transfer-Encoding" header
> includes "chunked", and the file is then received in an unspecified
> number of blocks.  You can use HTTP_QUERY_TRANSFER_ENCODING to verify
> that.
>
> If that is the case, then there is not way to know the size of the
> data during the actual transfer.  You would have to send a separate
> HEAD request beforehand.
How?
Since the data is likely generated
> dynamically, however, the size may not exactly match what is actually
> being downloaded afterwards, so watch out for that.  Otherwise, during
> a chunked transfer (or any other transfer that does not include the
> "Content-Length" header), you would not be able to use a progress bar
> at all, so you would just have to show the running number of bytes
> received instead.
> Gambit
HTTP_QUERY_TRANSFER_ENCODING returns chunked. I can live with displaying the number
of bytes downloaded. At least it hints to the user that something is actually happening.
Thanks Remy!
Mike

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive