cURL / Mailing Lists / curl-library / Single Mail

curl-library

Resume Upload Problem

From: Juan Ignacio Hervás <jihervas_at_iies.es>
Date: Wed, 04 Dec 2002 10:20:58 +0200

Hi,
I am trying to upload files using curl-library as an FTP CLIENT and I find
problems when I try to resume a broken upload. The situation is this: When
I find than there is a file with the same name and less size in the
destination folder (I am not checking date and time yet), I get the size
and try to append to the target beginning at that position. Sometimes I get
this error: "Upload unaligned file size" but usually I don't receive any
error but the transfer overwrite from the beginning and the final file is
completely wrong!
I am testing working with War-FTP server (version 1.65 and 1.70) and
Filezilla server, and the results have been the same in all of them.

I show you briefly the sequence I am using in my application because I
suppose that the problem may be here (I am very new using curl-library!).

curl = curl_easy_init ();
curl_easy_setopt (curl, CURLOPT_PORT, myPort);
curl_easy_setopt (curl, CURLOPT_USERPWD, login_password);
curl_easy_setopt (curl, CURLOPT_UPLOAD, TRUE);

sprintf (url, "ftp://%s/%s/", targetURL, target_upload_file);
curl_easy_setopt (curl, CURLOPT_URL, url);

curl_easy_setopt (curl, CURLOPT_READFUNCTION, MyRead);
curl_easy_setopt (curl, CURLOPT_READDATA, hfile);

curl_easy_setopt (curl, CURLOPT_INFILESIZE, file_size);

curl_easy_setopt (curl, CURLOPT_FTPAPPEND, TRUE);
curl_easy_perform (curl);

Do I need to call the CURLOPT_RESUME_FROM option to resume broken upload? I
have used it just after the CURLOPT_FTPAPPEND all and it doesn't work also.

II will be very grateful if anybody can help me or send me any example.
Thanks in advance.

-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET
comprehensive development tool, built to increase your
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
Received on 2002-12-04