cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Content-Length 0?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 23 May 2008 20:46:27 -0700

On Fri, May 23, 2008 at 07:04:44PM -0700, Ravi chandra padmala wrote:
> http://neenaoffline.one09.net/crap/cget.c
>
> I am trying to get the content length before downloading the file,
> the code above doesn't work, always shows content length as 0,
> why is that?

Three problems: One is that you're passing in an uninitialized pointer to
curl_easy_getinfo. Two, CURLINFO_CONTENT_LENGTH_DOWNLOAD doesn't take a
pointer to long, it takes a pointer to a double. Three, the remote web
server doesn't provide a length for this URL, probably because it's a
dynamically-generated directory listing.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-05-24