cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Content-Length

From: Roth, Kevin P. <KPRoth_at_MarathonOil.com>
Date: Thu, 22 Aug 2002 14:13:51 -0400

Unfortunately, although Content-Length may be required by HTTP, it doesn't always get sent. Dynamic pages (for example those produced by Active Server Pages) are created "on-the-fly", and the headers are sent back to the client before the actual content is determined. Thus sending the size in advance of an unknown body is not possible... Thus there's no curl option that will help in this case.

If you need this header for a particular piece of frequently-downloaded content, you might consider contacting the person in charge of that web site to see if there's anything they can do to help. Otherwise, you'll just have to download it in order to know the size.

Thanks,
--Kevin

-----Original Message-----
From: Raphael Summers [mailto:raphael.summers_at_theseed.net]

I am trying to identify the size of an http file before I download it.
[...]
It appears that
not all websites contain that particular header though. I have discovered
subsequently that it is in fact required by the protocol.
I am therefore led
to believe that I am doing something wrong.

Is there a way of ensuring that the Content-Length header is always
downloaded? If not, can you suggest another way of identifying the size of
the file without the need to download it first.

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r
Received on 2002-08-22