Knowledge Essentials - 3Essentials Hosting

FTP basics, what is binary vs ascii mode?

Article ID: 1619

 Back to Search

File transfers over FTP take two different forms, ASCII and binary.

ASCII, otherwise known as American Standard Code for Information Interchange, is a set of 128 symbols that any computer in the world can display.  Any file that is made up of text or text-based components, such as an HTML file, text file, or PostScript file, is an ASCII file.  Binary files, on the other hand, are structured differently, and therefore require a different style of transfer. Images, applications, and generated archive/cabinet files such as .zip and .tar files are all binary file types.

Most FTP clients do support autodetecting which transfer method to use based on the type of file being transferred, and will also support manually specifying the method if you wish to override the auto-detect.  Both ASCII and binary files can be sent in binary mode with no problems, but sending a binary file in ASCII mode will corrupt the binary file’s structure.  If in doubt, transfer in binary mode.

These file types are safe for ASCII transfer:
  • Text files
  • HTML files
  • CGI scripts
... common file extensions for these:
  • .htm .html .shtml .php .pl .cgi .js .cnf .css
  • .htaccess .map .pwd .txt .grp .ctl

These file types must be transferred in binary mode:

  • Images
  • Applications
  • .zip, .sit or .tar packages
  • Proprietary file formats such as .doc, .xls, .fla, .swf
  • Anything that’s not made entirely of text characters
...common file extensions for these:
  • .jpg .gif .png .tif .exe .zip .sit .rar .ace
  • .class .mid .ra .avi .ocx .wav .mp3 .au
  • .doc, .xls, .fla, .swf

Downloads Associated With This Article
No downloads are currently associated with this article.