cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: ftp download problem

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 15 Oct 2001 16:37:58 +0200 (MET DST)

On Mon, 15 Oct 2001, MEHUL PATEL wrote:

PLEASE don't take curl related conversations off the list without a good
reason.

> See i tried curl 7.9(not lib) and its also doing same thing. here is my
> output from curl 7.9

I was referring to a protocol dump, not just a curl output dump. But I since
you showed me the exact URL, I tried it and now I know why that happens!

This is why: when curl gets a file using FTP, it just change directory to
where the file is and gets it with the RETR command. Most FTP servers include
the file's size in the reply string to RETR, but this ftp.us.dell.com server
does not. So, curl downloads the file without knowing its full size prior to
download.

When you select a resumed download, we have a different situation. curl will
then try to get the file size first, then set the resume offset and then
download. That makes it know the file size at the time of the download!

Gettting file sizes from ftp servers is done with the SIZE command, which is
not strictly kosher and thus it is not possible to get a file's size on older
servers. The behavior you noticed was because the server replied a stupid
RETR reply but still supported the SIZE command.

Yes, we could make curl attempt to run SIZE on all files before downloading.
When anyone bring me such a patch, I'll probably apply it rather soon.

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