cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLINFO_CONTENT_LENGTH_DOWNLOAD ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 5 Mar 2001 08:54:25 +0100 (MET)

On Thu, 1 Mar 2001, Kai Zaunick wrote:

(I'm sorry for this delay in my response.)

> 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.

It is only this good thanks to feedback and help from others.

> 1. Is there a way to retrieve the total size without downloading the
> complete file (FTP and HTTP) inside libcurl.

Hm. I think we might need to go over the current getinfo() options to clear
up some confusions (most of it in my head definately).

At this point, I think most of the getinfo() options give you the sizes for
the download, not for the complete remote file. I do however believe that you
may need to do a separate HEAD check on the file to get the total size of the
file, as the Content-Length: size when you get a file with a range is set to
the current size being sent, isn't it (i.e not the total size)?

You can do this yourself today by doing a HEAD and parsing the headers. A bit
more work, but nothing really tricky.

> 2. What is the difference between CURLINFO_CONTENT_LENGTH_DOWNLOAD and
> CURLINFO_SIZE_DOWNLOAD?

CURLINFO_CONTENT_LENGTH_DOWNLOAD is meant to be the Content-Length: (or
equivalent) size sent by the remote server.

CURLINFO_SIZE_DOWNLOAD is the amount of data actually and truely downloaded.

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-03-05