cURL / Mailing Lists / curl-library / Single Mail



From: Jaepil <>
Date: Sat, 17 Nov 2001 14:34:20 +1300

I'm having a problem with sending a zipped file.

When i try to send files which is created by my application.
I get CURLE_WRITE_ERROR code on the half way of the first file.
The error occurs on the same portion of the first file, every time i try.

I tried with other machine, and it produces no error code.
This makes my life much harder.

The application is built on MSWindow98 with Borland C++ Builder.
Where libcurl is imported as LIB, not DLL.

If I understood correctly, the error occurs when Header/Body file
cannot written or when server cannot write file. Can anyone tell
me what is the most likely situation/cause???

This is the main part of the function that i made for sending files.

    try {
        curl = curl_easy_init();
        if(curl) {
            curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_func);
            curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
            curl_easy_setopt(curl, CURLOPT_URL, "htt:://");
            curl_easy_setopt(curl, CURLOPT_WRITEHEADER, infile);
            curl_easy_setopt(curl, CURLOPT_FILE, bodyfile);
            curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
            curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
            curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, pbar);
            curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, myprogress_callback);
            curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 8);

            res = curl_easy_perform(curl);

    } catch (...) {
        ShowMessage("Fatal error in transaction.");

Received on 2001-11-17