cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: FTP upload problems with libcurl 7.9

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 15 Oct 2001 11:36:40 +0200 (MET DST)

On Mon, 15 Oct 2001, Extern Caron-Fauriat Stéphanie (Tenovis;PN-SYS/DAC) wrote:

> [Stéphanie Caron] In fact, the local file is called 'd:\tmp\uploadthis.txt'
> and should be stored as 'while-uploading.txt' and then renamed as
> 'renamed-and-fine.txt'.

> But if I asked to store it as uploadthis.txt, the pb is the same. It
> seems to happens in the function Transfer at the line nread =
> data->set.fread(buf, 1, conn->upload_bufsize, data->set.in);

*beep*

It is once again the dreaded little differences that come back to haunt us.
Let me quote a little snippet from the curl_easy_setopt docs:

     CURLOPT_INFILE
             Data pointer to pass to the file read function. Note
             that if you specify the CURLOPT_READFUNCTION, this
             is the pointer you'll get as input. If you don't
             specify a read callback, this must be a valid FILE
             *.

             NOTE: If you're using libcurl as a win32 DLL, you
             MUST use a CURLOPT_READFUNCTION if you set this
             option.

Please read this last section extra carefully, as that should apply to your
situation, if I'm not mistaking.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-15