cURL / Mailing Lists / curl-library / Single Mail


Re: write files in other computer from mine by ftp

From: Daniel Stenberg <>
Date: Thu, 13 Sep 2007 15:14:13 +0200 (CEST)

On Wed, 12 Sep 2007, Marco Antonio wrote:

(please don't top-post:

> Now, I think it is not possible write a file directly in the remote file.

I don't understand what makes you think that.

> One have to write it in a local directory and after that, pass the file by
> "CURLOPT_PUT". Is it all right?

No. You can set a read callback and then libcurl will call that to get the
data to upload, and you can provide that data from a memory buffer or however
you like.

> But now, I have a new problem! When the transfer is done, it does not do
> move file_from to file_to and appear this: Error: [' 18 '] Uploaded
> unaligned file size (22 out of 5203504474269679638 bytes)
> Does anybody know why? Because "file_info.st_size" is 22 (is ok!).

This happens when libcurl and your application have different ideas about the
size of the curl_off_t type, which typically is because you don't define
_FILE_OFFSET_BITS to 64, or similar magic to enable support for large files.

  Commercial curl and libcurl Technical Support:
Received on 2007-09-13