NCSA Mosaic for the Macintosh User Guide: Customizing

Configuring Viewers For New File Types

You may come across a new file type that is not currently handled by NCSA Mosaic. If you have an external viewer that can display this file type, you can configure Mosaic to handle the new file type.

There are basically three steps:

  1. Define a MIME type for the new file type.
  2. Map a file extension onto the new MIME type.
  3. Set the external viewer to open files of this type.
As an illustration, here's how you would configure NCSA Mosaic to handle HDF files. The specifics of this example (HDF, NCSA Image) aren't important. The procedure are the same for defining any other MIME type.

NOTE: HDF (Hierarchical Data Format) is a file format developed by NCSA for scientific data sets and images. NCSA's visualization tools, such as NCSA Image, all use HDF files.

Defining a New MIME Type

To define a new MIME type (in this example, for HDF files),

  1. Select Preferences... from the Options menu to bring up the Preferences dialog box.
  2. Click the Helper Application... button to bring up the Helper Applications dialog box.
  3. Click the Add document type... button, which brings up the following dialog box:

  4. Type in application/x-hdf for the MIME type. (The major type is application because it is binary data that doesn't fit in one of the other major categories of text, image, audio or video. The x- prefix in the subtype indicates that it is not one of the officially registered subtypes.) See xref for more information about the meaning of MIME types. You should check if there is MIME type already defined before defining your own.
  5. Click OK. If you scroll to the bottom of the Document Type -> Application menu, you will see a new entry: application/x-hdf -> TeachText.

By default, a new MIME type has TeachText chosen as its external viewer. Because TeachText cannot view HDF files, you should change the external viewer (to NCSA Image or other program that can view HDF files) using the procedure described in xref.

Notice that the Remove document type button is highlighted. You can delete MIME types that you define yourself, but you cannot delete any of the styles that are pre-defined by Mosaic.

Defining a New File Extension

Some servers do not include MIME type information, in which case Mosaic tries to infer the MIME type from the file extension. For example, for the application/x-hdf MIME type defined in the previous section, you probably would want to specify that files ending in .hdf are HDF files.

  1. In the Helper Applications dialog box, click on Add Extension...
  2. In the resulting dialog box, type hdf in the Extension: field and select application/x-hdf from the Mime type: pop-up menu.

  3. Click OK.
To remove a file extension mapping that you have defined, click on its entry in the Extension -> Document Type list and then click on the Remove Extension button. You cannot delete nor modify any of the pre-defined file extension mappings.