cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

(no subject)

From: Chris Johnson <chrisj_at_terminalreality.com>
Date: Tue, 17 Nov 2009 13:58:59 -0600

I am developing an application with C++ and libcurl. I can download and upload files fine, but I have an issue when trying to get the size of the file that I want to download from the SFTP server before downloading the file.

I am accessing an SFTP server (via sftp://). I use curl_easy_getinfo to set both CURLINFO_CONTENT_LENGTH_UPLOAD and CURLINFO_CONTENT_LENGTH_DOWNLOAD thinking that would give me the size of the file I am trying to download. Unfortunately, CURLINFO_CONTENT_LENGTH_UPLOAD returns -1.0 and CURLINFO_CONTENT_LENGTH_DOWNLOAD returns the size of the file I downloaded last. Is there a way to get the size of the file I'm trying to download before I actually download the file? Does the SFTP server need to be setup with certain attributes to allow this?

Thanks,
Chris J.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-17

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET