cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: uploaded file is of 0 bytes using FTP-SSL with libcurl

From: Michael Jahn <mikej06_at_hotmail.com>
Date: Fri, 20 Jan 2006 15:23:38 +0000

I think it is another problem. I had a similar error. I uploaded a string
from memory with a
own READFUNCTION. While I am in debug-mode there are no problem. But in
release
build without break points I got a filesize of 0. Sometimes if the string
was large enough
the filesize of the uploaded file was a part of the length of the string.
I figured out a little workaround. My program makes a little sleep() if
there is not data
any more for uploading. It's the point when I return 0 within my
READFUNCTION.
So I think, the socket for uploading is closed to fast. It seems that there
is data on the
port waiting for transmitting but libcurl closes the socket to fast. So the
data is discarded.
If there is less then 4kbytes data to send the resulting filesize on the
server will be 0.
In other cases it will be a part of the filesize (the amount of data which
was transmitted
before the socket was closed).

It's only assumption.

Michael

>From: Daniel Stenberg <daniel_at_haxx.se>
>Reply-To: libcurl development <curl-library_at_cool.haxx.se>
>To: azad amm <ammazad_at_rediffmail.com>, libcurl development
><curl-library_at_cool.haxx.se>
>Subject: Re: uploaded file is of 0 bytes using FTP-SSL with libcurl
>Date: Thu, 19 Jan 2006 00:05:37 +0100 (CET)
>
>On Wed, 18 Jan 2006, azad amm wrote:
>
>>The problem that i face is that the client program runs completely.
>>However on the server's user home directory, the file uploaded has the
>>name while-uploading.txt with 0 bytes in it.
>
>...
>
>>* Uploaded unaligned file size (1 out of 21474908464 bytes)
>
>Is that the correct file size? Either way, it seems to only get a single
>byte uploaded...
>
>To me it seems like you check and report the size of one file, and then the
>read callback reads from and returns data from another...
>
>--
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

_________________________________________________________________
Sie suchen E-Mails, Dokumente oder Fotos? Die neue MSN Suche Toolbar mit
Windows-Desktopsuche liefert in sekundenschnelle Ergebnisse. Jetzt neu!
http://desktop.msn.de/ Jetzt gratis downloaden!
Received on 2006-01-20