News: 24 November 2018 - TP Docs is now updated to Version 1.6.1...!

Docs Navigation

Search Articles


Search in titles
Search in article texts





Author Topic: What Is ASCII & Binary?  (Read 6436 times)

Offline Xarcell

  • Full Member
  • ***
  • Posts: 137
What Is ASCII & Binary?
« on: April 25, 2008, 04:12:03 AM »
Summary

In FTP you have to decide whether your transfers are to be in ASCII or binary mode. If the files are not uploaded in the proper mode, your browser will have trouble reading them and they will not display properly.

We won't go into detail about the differences between the 2 modes. It mostly deals with 0's and 1's.

Setting Your FTP Program to "Auto":

Most FTP programs have the option to set your upload to auto. What this usually does is compare the file type you're transferring against a list of known file types and set it to binary or ascii upload on its own.

By default, most FTP programs will have a pre-set list of files to be transferred in ascii and will upload / download everything else in binary. (These settings are in different places depending on the program you are using. Check the "Read Me" file or their Website if you can't find it.) Be sure to double check that the files you want to transfer are in the appropriate list.

The general rule of thumb is if you can view the file in a text editor like notepad (ie. .html, .js, .css files etc) you should upload in ASCII mode, most others (including images, sound files, video, zip files, executable's etc) should be uploaded in Binary.

Exceptions to the Rule

It seems all things related to computers have exceptions to the rules. Yes, this is yet another case of it.

If your text files contain international characters (ie. Chinese or Japanese text), they are to be uploaded as binary. The reason is that ascii takes into account differences between DOS and UNIX files (7 bits) but it doesn't do well with text using higher bits.

ASCII Files
.htm .html .shtml .php .pl .cgi .js .cnf .css
.forward .htaccess .map .pwd .txt .grp .ctl

Binary Files
.jpg .gif .png .tif .exe .zip .sit .rar .ace
.class .mid .ra .avi .ocx .wav .mp3 .au



Doc Written By: Xarcell
« Last Edit: May 13, 2008, 11:43:28 AM by Ken. »