previous | start | next

MIME Types and Encodings

The Content-Type: header in MIME specifies a "MIME type" for the data which follows. The MIME type is used to open a suitable application program to display the attached data. Some standard MIME types include:
 
text/plain lines of ASCII text
text/html HTML text
image/gif GIF image
video/mpeg MPEG video
application/postscript PostScript document
application/octet-stream Arbitrary data

ASCII Encoding

In RFC822, the message body may contain printable ASCII. For compatibility, attached non-ASCII (8 bit, or binary) data (eg images, sounds, etc) must be encoded into an ASCII, or textual representation. Encoding methods include "quoted-printable" and (most commonly) "Base64".
 
In Base64 encoding, the binary data is subdivided into groups of 3 bytes (24 bits) in length. These 24 bits are then subdivided into 4 groups of 6 bits. Each 6 bit group is then represented as one of 64 printable ASCII characters, taken from the 95 printable characters in ASCII. Finally, each of the printable characters is sent as an ASCII character in one byte. Thus, 24 bits of binary data are sent as 32 bits of ASCII data in the encoded message.
 
Lecture 4: Applications #2: Email Copyright © 2005 P.Scott, La Trobe University Bendigo.


previous | start | next