Ftp – On what basis should you select ACSII or Binary transfers over FTP

ftp

FTP clients, including those used programatically, allow the user to select ASCII or Binary transfers when uploading a file. Some clients also support some flavor of Auto, where you leave it to the FTP client to decide.

What are some correct reasons to select one format over the other? How does one decide? Besides the clients supporting Auto-detect, how can one automate this decision?

Best Answer

Windows uses both a carrige return and a line feed to show the end of a line in a text file. Unix generally uses only one (I think a line feed). When you ftp files as text, the ftp program will convert line endings for you. In binary mode the file is transfered exactly as is. So if you are transfering a text document then use ASCII. Anything else and binary is probably your best bet. As others have pointed out, most modern text editors will deal with line endings anyway (Notepad doesn't, nor is it modern :) ) so binary is by far the safer option. I also agree with @njsf, I don't like files being changed behind my back. I have editors that are quite capable of doing a find and replace to fix the line endings if it becomes necessary.

Related Topic