Hacker News new | ask | show | jobs
by _notreallyme_ 1040 days ago
> the FTP protocol had a "binary mode" and a "text mode" because you can't safely transfer binary data from machines with incompatible word sizes and endianness

I'm not sure to follow you here. The TYPE modes are ASCII, IMAGE, EBCDIC and Local byte size. The "binary mode" being Image and "text mode" being ASCII in current FTP clients.

The IMAGE mode is the one that actually transfers file as they really are without any changes. The other 3 formats are actually used for character conversion, with an additional parameters to specify telnet or ASA conversion, and even changing the byte size in case of L.

In the end, the "text mode" is the one that will tend to corrupt your file (thanks to the CR/LF, LF/CR, LF discrepancy between the 3 major desktop OS).

Always choose TYPE IN (Image Non-print) by default!

2 comments

Thanks for the reminder — it’s been decades since I thought about FTP, much less used it.

While we’re at it, let’s not forget that it was originally also the transport for network mail!

I think SMTP would be a more relevant example.
Does smtp have another mode other than text?
SMTP generally assumes you only have 7bit transfer. You have to negotiate a protocol extension (8bitmime) to send bytes with a leading 1.

https://datatracker.ietf.org/doc/html/rfc6152