Subject: SIZE command of ftpd depends on binary or ascii mode
To: None <>
From: Klaus Heinz <>
List: tech-userlevel
Date: 12/22/2005 02:25:55

I just encountered a surprising behaviour of ftpd on

/pub/NetBSD/packages/pkgsrc/README-all.html is not accessible through my
local apache proxy server (1.3.34 from pkgsrc).

A closer look with ethereal revealed this:

  SIZE README-all.html
  550 README-all.html: file too large for SIZE

( It seems apache uses the SIZE command as a heuristic method to determine
  whether a filename is a directory or not because the packet trace
  continued with
  CWD README-all.html
  550 README-all.html: Not a directory

On the other hand our /usr/bin/ftp had no problems at all to determine
the size of the file.

The significant difference is that apache does not set the type of data
(ascii or binary) explicitly before this SIZE command, while our
/usr/bin/ftp does set type "binary" (at least with an URL argument of and a subsequent
"size README-all.html").

Is this behaviour of ftpd intended (and correct)?

If it is tunable (I found nothing about this in the man pages) I think
this should be changed on