Re: ftpget is adding cr nl to the end of the lines

From: Don Lewis <>
Date: Fri, 10 Oct 1997 03:58:01 -0700

On Oct 10, 12:28pm, wrote:
} Subject: Re: ftpget is adding cr nl to the end of the lines
} Apologies for being so late in commenting...
} said:
} > If you're fetching a text file, the only sane thing to do is to do an
} > ASCII mode tranfer which always changes the line termination to CR/
} > LF. Your browser should then see the MIME type text/plain or whatever
} > and translate the CR/LF into the native line termination for your
} > platform.
} I disagree, but acknowledge that this is contentious.
} Does Squid FTPGET honor the ;A and ;I modifiers specified in
} RFC 1738?

Nope, but IMHO is should. I'd code it up if I had the time. Getting
the transfer mode set should be pretty easy. The icky part is redoing
the directory listing so that the user can choose the transfer mode.
Also, what about the proper user education?

} If so, that would make it possible to force "I" mode in the case
} that is creating trouble for us here in a reasonably clean fashion.

IHMO, your client is broken. If it sees a text/plain (added by squid)
document being returned, it should store the file using the proper line
termination format for your platform. While you could get \n line
termination if you fetched the file from a Unix FTP server using a ;I
modifier, you're SOL if the file resides on a Windows NT FTP server.
No matter what transfer mode you use to fetch a .txt file from an NT
FTP server, the line termination on the wire will be \r\n, since that's
the native line termination in the DOS/Windows world.

If you use a ASCII mode to fetch text files with a real FTP client,
it will store the file using the correct line termination, no matter what
flavor FTP server you connect to, assuming that the file you're fetching
is stored in the server's native text file format.

Out of curiosity, what does your client do if you fetch ftp:// URLs
directly (not using a proxy)?

} (I regard the "try to guess it" language in 1738 as a particularly
} offensive example of standardizing things that work part of the time....
} but have no better solution at the moment...)

I don't think there is since FTP doesn't have a way to communicate
file type information.

Unfortunately, squid doesn't give us an override in case it guesses wrong.
Another nice thing about the ;A and ;I modifiers is that they produce
distinct URL's, so we would know what transfer type was used to get the
data into the cache, and if we didn't like what we got, we could fetch
the file again with the other transfer type.

                        --- Truck
Received on Fri Oct 10 1997 - 04:00:22 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:37:16 MST