cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: ftp parse remote filesize from header

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 19 Oct 2011 11:48:41 -0700

On Wed, Oct 19, 2011 at 04:34:34PM +0200, Jonas Schnelli wrote:
> Just to be sure and check other alternatives:
> When getting only the header while loading a FTP file (CURLOPT_NOBODY = 1, CURLOPT_HEADER = 1), do i have to parse the header output?
> Is the output generated by curl and will it be always the same (different servers)?
> Or is there a more easy option to load the remote filesize / check if file exists on ftp/sftp?

You can use curl_easy_getinfo to get the file size after the transfer
without having to parse any headers yourself.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-10-19