When a web browser receives a document from a server it actually gets two pieces of information: the header and the body. The header contains information about the message and body. One of the most important pieces of data, called the MIME type specifies what the body of text describes. For instance, a GIF image is given the MIME type of image/gif, a JPEG image is image/jpg, and postscript is application/postscript. A class of types, chemical/*, has been created for chemical models so the MIME type for PDB files is chemical/pdb, for XYZ is chemical/xyz, etc.
The web browser uses the MIME type to determine how to view the body of the message. Some of the documents are viewed by the browser itself, like text/html which describes HTML documents. In other cases, the browser has to start up another application. From here on, we'll describe how Mosaic and Netscape do this. First, it saves the incoming message body to a temporary file. It then scans the global and local mailcap files to determine which application is used to view the given MIME type. The application, which must take a file name on the command line, is then executed. When the application exits, the temporary file is deleted.