Why does it matter which mode?
If you upload images etc. as ascii you'll end up with corrupted files. Some browsers seem capable of figuring it out, but not all... and not all the time.
Same thing with uploading text files as binary. While this is less important for html files, scripts will have a HUGE problem with it and will just not work.
EXCEPTIONS TO THE RULE OF THUMB:
If your text files contain international characters (ie. Chinese or Japanese text), they may have 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.
SUMMARY:
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
In binary code, the word "no" can be represented using ASCII values. The letter "n" corresponds to the ASCII value 110, which is 01101110 in binary, and the letter "o" corresponds to 111, which is 01101111 in binary. Therefore, "no" in binary code is 01101110 01101111.
By using a binary number called ASCII code
The word "Hello" can be represented in binary using ASCII encoding. Each letter corresponds to a specific ASCII value that can be converted to binary. For example, "H" is 72 (binary 01001000), "e" is 101 (binary 01100101), "l" is 108 (binary 01101100), and "o" is 111 (binary 01101111). Therefore, "Hello" in binary is: 01001000 01100101 01101100 01101100 01101111.
ASCII character array (including null-terminator): {'N','e','t','w','o','r','k','\0'} ASCII character codes (decimal): {78,101,116,119,111,114,107,0} ASCII character codes (octal): {4,7,1,4,5,3,5,0,7,3,5,5,7,3,4,4,6,5,4,0,0} ASCII character codes (hexadecimal): {4E,65,74,77,6F,72,6B,00} ASCII character codes (binary): {01001110,01100101,01110100,01110111,01101111,01110010,01101011,00000000} When treated as a 64-bit value, the ASCII-encoded word "Network" has the decimal value 5,649,049,363,925,854,976.
In binary, the name "Connor" can be represented using ASCII values for each character. The ASCII values are: C (67), o (111), n (110), n (110), o (111), r (114). When converted to binary, "Connor" becomes: 01000011 01101111 01101110 01101110 01101111 01110010.
To convert the name "Jason" into binary code using ASCII values, you first determine the ASCII values for each character: J (74), a (97), s (115), o (111), n (110). Then, you convert each ASCII value into its binary equivalent: J (01001010), a (01100001), s (01110011), o (01101111), n (01101110). Therefore, "Jason" in binary code is: 01001010 01100001 01110011 01101111 01101110.
In binary data, the letter "A" is represented by the ASCII code 65, which translates to the binary value 01000001. Each character in binary data is typically represented using 8 bits (1 byte), so "A" is stored as the sequence of bits 01000001. In other encoding systems, such as UTF-8, it remains the same since it is a standard ASCII character.
Chracters are represented using binary digit combinations. For example the ASCII American Standard Code for Information Interchange is one such encoding.
Stored? It would not be stored as ASCII -- ASCII (American Standard Code for Information Interchange) is in common use in the US (EBCDIC - Extended Binary Coded Decimal Interchange Code is another type of ASCII and is used in many European countries.)My name is, for example, Bill TheCat - TheCat is my surname and is represented (not stored) in ASCII as "TheCat". Computers store data as 0s and 1s (in BINARY, which is not the same as EBCDIC) format.
The binary code for "HAPPY BIRTHDAY" can be represented using ASCII values for each letter. For example, the ASCII value for 'H' is 72, which is 01001000 in binary, and this format continues for each character. The complete binary representation for "HAPPY BIRTHDAY" would be: 01001000 01000001 01010000 01010000 01011001 00100000 01000010 01001001 01010010 01010100 01001000 01000100 01000001 01011001.
The name "Oscar" in binary code, using ASCII encoding, is represented as follows: O = 01001111, s = 01110011, c = 01100011, a = 01100001, r = 01110010. Therefore, "Oscar" in binary is 01001111 01110011 01100011 01100001 01110010.
The ASCII HEX Encoded/Binary String method of obfuscation has been very popular, although there are new methods that have been suggested. By using the ASCII HEX Encoded/Binary String method, the resulting code injection is difficult to identify as a threat.