ASCII vs. Binary Mode

Probably the most misunderstood part of FTP transfers is the difference between ASCII and Binary mode. ASCII stands for American Standard Code for Information Interchange, and is a type of character encoding based on the English language used on devices that handle information stored in text. It includes 33 non-printed control characters and 94 printed characters such as letters and punctuation.

When files are transferred in ASCII mode, the transferred data is considered to contain only ASCII formatted text. 

Binary mode refers to transferring files as a binary stream of data. Where ASCII mode may use special control characters to format data, binary mode transmits the raw bytes of the file being transferred. In this way, the file is transferred in its exact original form.

Which Mode Is Best?

In most cases, the user does not need to worry about manually configuring the proper mode when transferring files. FTP clients usually employ a method of automatically determining the proper transfer mode based upon the contents of the file or the file's extension.

For times when the transfer mode must be manually selected, ASCII should be used when transferring text files.

Some of the common file types that should be transferred in ASCII mode include:

* txt, htm, html, shtml, css, asp, vbs, js, php, pl, cgi, cnf, forward, htaccess, map, pwd, grp, ctl 

Some of the common file types that should be transferred in Binary mode include:

* pdf, doc, jpg, gif, png, tif, exe, zip, sit, rar, ace, class, mid, ra, avi, ocx, wav, mp3, au

If a file containing Binary data is sent using ASCII mode, it will most likely end up being corrupted. If you're having problems with corrupted file transfers, try using the Binary mode when transferring your files.

Some common file formats that are sometimes mistakenly transferred in ASCII mode includes:

* pdf - PDF files can contain embedded binary data such as images.
* doc - Microsoft Word documents are a binary formatted file.
* In general, all audio, video, and image file formats are binary. 

Library Index

 
© 2007-2008 Frisco Depot, All Rights Reserved