cURL / Mailing Lists / curl-library / Single Mail

curl-library

FTP: Error 18 (Transferred a partial file) on RETR

From: Olivier ROBIN <orobin_at_histor.fr>
Date: Wed, 27 Jul 2005 15:35:26 +0200

For a RETR operation, it looks like that Libcurl matches the response of the server on the SIZE command previously sent and the real size received.

So, if there is a difference (and it's sometimes the case with the server I use), Libcurl closes the connection and generates the error 18 "Transferred a partial file".

=> TYPE I
<= 200 TYPE is now 8-bit binary
=> SIZE sony_part_5.mxf
<= 213 240887296
=> RETR sony_part_5.mxf
<= 150-Connecting to port 1785
<= 150 235241.5 kbytes to download
== Connection accepted from server
== Getting file with size: 240887296
Transfer progress : 2896 bytes transferred
Transfer progress : 4721488 bytes transferred
Transfer progress : 17896744 bytes transferred
Transfer progress : 23855104 bytes transferred
== transfer closed with 217032192 bytes remaining to read
== Remembering we are in dir dirPartial/
== Received only partial file: 23855104 bytes
== Closing connection #0
Error 18: Transferred a partial file

Why does this case need to close the connection ? I understand the generation of the error 18 but I don't understand the disconnection. Is it possible to stay connected ?

Thanks if you can give me an explanation.
Received on 2005-07-27