cURL / Mailing Lists / curl-library / Single Mail


RE: Possible Issue with libCURL File Download

From: Patrick Monnerat <>
Date: Mon, 8 Jul 2013 13:37:23 +0200

Ryan wrote:

> I'm trying to write a program that downloads a file from a remote FTP
server, appends one line to the end of it, and then re-uploads it...

You probably would have a much lighter solution using option

> ... which is the size of the remote directory listing mysteriously
getting tagged onto the front of the file).

I did not run your program, but from reading the code, it seems you
effectively download the root directory. I mean you call
download(...REMOTE_URL...) which is the server name only
( while you probably intended to download

Try using

download(DATABASE_FILE, "musiclist.txt", REMOTE_URL "/"

And in any case, check the content of the local file before uploading...

Although this is not the cause of your problem, please also note that
curl_global_init()/curl_global_cleanup() should normally be called once:
I suggest you do this in the main program.

List admin:
Received on 2013-07-08