cURL / Mailing Lists / curl-library / Single Mail

curl-library

404 error at upload (when file exists)

From: Fabian Matyas <fabianmatyas_at_yahoo.com>
Date: Tue, 22 Feb 2005 02:40:25 -0800 (PST)

Hi everyone!

I'm writing a kind of browser on Mac OS X 10.3.5 which
should be able to upload/download/remove files from a
server. Here is the scenario when the problem appears:
while I'm doing an upload of a folder, I
remove/download a file from the server. This later
file is not related to the folder. From this point on,
the files from the folder are being uploaded only at
even or odd positions:
File1 - uploaded 100%
File2 - failed
File3 - uploaded 100%
File4 - failed
.......
The error message is following:
Error message = The requested file was not found, HTTP
error code = 404

There are situations when more files fail to upload
one after another.

Is there anyone who experienced this kind of error, is
it corrected in some later versions?
The cURL library I have: libcurl.2.0.2.dylib

Here is the code I use to prepare
an Upload:
------
                        curl_easy_setopt(curl, CURLOPT_URL, [url
UTF8String]);
                        curl_easy_setopt(curl, CURLOPT_HTTP_VERSION,
CURL_HTTP_VERSION_1_1);
                        curl_easy_setopt(curl, CURLOPT_PUT, TRUE);
                        curl_easy_setopt(curl, CURLOPT_READDATA, f);
                        curl_easy_setopt(curl, CURLOPT_READFUNCTION,
read_callback);
                        curl_easy_setopt(curl, CURLOPT_INFILESIZE,
(int)file_stat.st_size);
                        curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, self);
                        curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
read_progress_callback);
                        curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
                        curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
                        curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 8192);
                        curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
                        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER,
errormsg);
                        
                        code = curl_easy_perform(curl);

a Download:
---------
                        curl_easy_setopt(curl, CURLOPT_URL, [url
UTF8String]);
                        curl_easy_setopt(curl, CURLOPT_HTTP_VERSION,
CURL_HTTP_VERSION_1_1);
                        curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
                        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
write_callback);
                        curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, self);
                        curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
write_progress_callback);
                        curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
                        curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 2 *
8192);
                        curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
                        curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
                        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER,
errormsg);
                
                        code=curl_easy_perform(curl);

Regards,
Fabian Matyas.

                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
http://info.mail.yahoo.com/mail_250
Received on 2005-02-22