cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: ftp upload results in (nil) filename

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 3 Feb 2003 22:28:04 +0100 (CET)

On Mon, 3 Feb 2003, Tom Sorensen wrote:

> I'm trying to use libcurl to upload some files in a C++ program (no
> wrapper, just straight libcurl). I'm feeding curl data straight from memory
> via the CURLOPT_READFUNCTION and CURLOPT_READDATA options. While the
> connect and transfer are fine, curl always uploads the file as (nil). I see
> no way to actually set the remote filename through options either, but I
> could be missing an option.

You specify it in the full URL. The file name part, the right-most one, is
what it'll use on the remote site. Your URL ends with a slash, which thus
makes the file-part a NULL (written as "(nil)" by the sprintf() code).

If you can think of a place and wording to add to the docs to make this
clear, please tell me!

> Speaking of which, the current curl_easy_setopt page on the web
> (http://curl.sourceforge.net/libcurl/c/curl_easy_setopt.html - didn't check
> SE or other versions) is missing sections due to bad HTML - notably
> CURLOPT_READDATA and anything else near a "NOTE" section. The man pages are
> fine though.

Hm. Weird. The haxx.se version seems to be fine! I'll investigate.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-02-03