Re: write files in other computer from mine by ftp
Date: Thu, 13 Sep 2007 11:07:55 -0300 (ART)
Daniel Stenberg <firstname.lastname@example.org> escreveu:>(please don't top-post: http://curl.haxx.se/mail/etiquette.html#top-post)
Sorry! I have not have time to read it!
>> Now, I think it is not possible write a file directly in the remote file.
> I don't understand what makes you think that.
As I am a beginning programmer, I thought I could send the name file and your contents to write remotely because supposedly it was faster!
>> 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.
Yes, thank you! I've changed "CURLOPT_INFILESIZE_LARGE" to "CURLOPT_INFILESIZE" and it worked well! I do not need files so much long. It was only for precaution!
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.html Flickr agora em portuguÍs. VocÍ clica, todo mundo vÍ. Saiba mais.Received on 2007-09-13