The MIME specification defines a set of header lines for body parts. These include MIME-Version, Content-type, Content-Transfer-Encoding, Content-ID, and Content-disposition. The conversion channel uses the Content-type and Content-disposition headers most frequently. An example of some MIME header lines is shown below:
Content-type: APPLICATION/wordperfect5.1;name=Poem.wpc Content-transfer-encoding: BASE64 Content-disposition: attachment; filename=Poem.wpc Content-description: "Project documentation Draft1 wordperfect format"
MIME header lines are not the same as general, non-MIME header lines such as To:, Subject: and From:. Basically, for Conversion channel discussion, MIME header lines start with the string Content-.
The MIME Content-Type header describes the content of the body-part. The Content-Type header format (with an example) is shown below:
Content-type: type/subtype; parameter=value; parameter=value...
type describes the type of content of the body part. Examples of type are Text, Multipart, Message, Application, Image, Audio, and Video.
subtype further describes content type. Each Content-type has its own set of subtypes. For examples: text/plain, application/octet-stream, and image/jpeg. Content Subtypes for MIME mail are assigned and listed by the IANA (Internet Assigned Numbers Authority). A copy of the list is at http://www.iana.org/assignments/media-types.
parameter is specific to Content-type/subtype pairs. For example, the charset and the name parameters are shown below:
Content-type: text/plain; charset=us-ascii Content-type: application/msword; name=temp.doc
The charset parameter specifies a character set for a textual message. The name parameter gives a suggested file name to be used if the data were to be written to a file.
Content-Type values, subtypes, and parameter names are case-insensitive.
The MIME Content-disposition header provides presentation information for the body-part. It is often added to attachments specifying whether the attachment body part should be displayed (inline) or presented as a file name to be copied (attachment). The Content-disposition header has the following format:
Content-disposition: disposition_type; parameter=value;parameter=value...
disposition_type is usually inline (display the body part) or attachment (present as file to save.) Attachment usually has the parameter filename with a value specifying the suggested name for the saved file.
For details on the Content-disposition header, refer to RFC2183.