Re: CURLINFO_CONTENT_LENGTH_DOWNLOAD ?
Date: Thu, 01 Mar 2001 06:38:27 -0500
1. Try CURLINFO_CONTENT_LENGTH_UPLOAD, it is supposed to report the
size of the file on the remote side. I told Daniel I thought
the names of these 2 variables were misleading.
2. CURLINFO_CONTENT_LENGTH_DOWNLOAD should report the size of
a local file, while CURLINFO_SIZE_DOWNLOAD reports how much
has been transferred in the current session in the download
direction. UPLOAD ones are reverse of DOWNLOAD ones, respectively.
CURLINFO_CONTENT_LENGTH_UPLOAD will get the size of the remote
file without downloading it. I believe it uses the HEAD reuest
to do it, getting the Content-Length of the remote file.
Kai Zaunick wrote:
> first of all I would like to thank Daniel for his really nice libcurl interface.
> It is easy to use and very powerful , especially with the callback functions.
> Currently I came accross a small problem which might be easily resolved:
> 1. I use the RANGE parameter to download the first 5kb of a file
> 2. After retrieving the download and computing a MD5 hash I would like to get the total filesize
> of that file.
> 3. Therefore I thought CURLINFO_CONTENT_LENGTH_DOWNLOAD is the right
> parameter for the curl_get_info. Unfortunately it just returns 5kb and not the total size of the
> file (as transmitted sometimes with the Content-Length in the HTTP header).
> My questions:
> 1. Is there a way to retrieve the total size without downloading the complete file (FTP and HTTP)
> inside libcurl.
> 2. What is the difference between CURLINFO_CONTENT_LENGTH_DOWNLOAD and
> Thanks for any suggestions!
> Curl-library mailing list
Curl-library mailing list
Received on 2001-03-01