Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What content cannot be FTP'd safely in binary mode?

Tags:

ftp

FTP predominately provides two transfer modes: ASCII and BINARY.

ASCII mode is generally intended for text-based content and that BINARY mode is generally intended for transferring content as-is, although transferring text-based content in BINARY mode is often perfectly safe.

ASCII mode is required for transferred CGI scripts to execute correctly - a CGI script transferred in BINARY mode will often result in an HTTP 500 upon execution.

Are there any other types of content that are known to require transfer by ASCII mode? What content will 'break' when transferred in BINARY mode that would not 'break' when transferred in ASCII mode?

like image 237
Jon Cram Avatar asked Jan 02 '11 19:01

Jon Cram


1 Answers

Binary mode will work for any data.

The problem with CGI scripts is that they are often edited on Windows with CRLF line endings, and the servers expect the line endings to be just LF. ASCII mode solves this. But modern servers don't care about this anymore, and also you can convert line endings on the server side if you have right tools, and also you can tell the editor on the client side to use LF as a line ending if you need to (at least Notepad++ seems to do this).

I never saw charset conversion taking place in ASCII mode, just because ASCII is a charset.

Update: ASCII mode can be used to convert data between EBCDIC and ASCII when connecting to mainframes. In this case binary mode would require manual conversion after transfer.

like image 146
Eugene Mayevski 'Callback Avatar answered Oct 13 '22 00:10

Eugene Mayevski 'Callback