cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

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

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET