About usContact usSite help
Quick links
Search this site

Adding MIME types

Introduction

The list of MIME types available are pre-defined for the Web Server which you have your web site hosted on. This list defines how certain objects are to be served by the web server, using the file extension to determine its type, e.g. .html as text/html. The pre-defined list of MIME types, though small, incorporates both useful and common MIME types.

The MIME type List

The MIME types which are pre-defined cover only a small amount of file types. A small compact list has been chosen over a fairly comprehensive list for several reasons.

  • Different platforms don't all necessarily associate the same file extension with the same file type as another platform. The more comprehensive the list, the greater the possibility for introducing conflicting MIME types, and file extensions.
  • A large comprehensive list, which would see the addition of new types, would reduce the maintainability and have repercussions for people using that file extension before it had a MIME type defined.
  • A well-defined small list, enables customers to create their site without the worry that a change in the near future may cause their site to no longer be served in the same manner. Thus providing a stable point of reference to work from.

The list of defined content-types

A list of the MIME types currently defined is available for you to view, and are briefly explained here. There are six main types predefined, these are : audio, application, image, text, video, x-world.

Each type consists of several subtypes for a range of common and well known formats on the Internet.

audio/
These subtypes loosely fall into three sections. Those which cover basic sound formats such as .au, .wav; those which define types for MPEG, and those for use with RealAudio.

application/
These subtypes loosely fall into three sections. This defines subtypes for compressed formats such as hqx, sit, zip; several document types pdf, Postscript (ps) and rtf. Subtypes for use with Shockwave applications.

image/
These subtypes are for different image formats, gif, jpeg, png and tiff.

text/
These subtypes are for text (the default Content-type); and two mark-up languages, html and sgml.

video/
These subtypes cover several the video formats available, MPEG, Quicktime, AVI and Vivo.

x-world/
There are two subtypes, which are both for use with VRML.

Adding MIME types to the list

Although we will not update the pre-defined list for you, as part of your Commercial Web Space you are able to add your own additional MIME types should they not be currently defined, or defined as another type. This is achieved by placing an AddType line in your .htaccess file, as below.

Note: The Web Support department will be able to help should you have problems doing this, but they will _not_ be able to update the pre-defined list for you.

To use a file type (eg .new) that is not currently being served by the server correctly you need to add it to the servers' MIME type list. You should use the files recommend MIME type if it has one. If this is unknown, using application/octet-stream will usually force the browser to save the file onto the hard disk. Note that you may need a plugin for the browser to display the file at all, or the relevant software.

It is recommended that to add your own MIME types you use the following method:

On your local computer, use a simple text editor and a create a file called access.txt (for instance) and insert the following text: AddType application/x-my-mime-type <extension>, for example:

  • AddType text/html html
  • AddType text/plain txt
  • AddType text/plain new

The 'AddType' specifies that you are adding a MIME type. In 'application/x-my-mime-type', is the MIME type and the 'x-my-mime-type' is the subtype. The '<extension>' is the extension of the new MIME type. On most platforms, the extension is the part of the filename at the end, after the '.' e.g. 'html' in 'index.html'.

Once you have created your file, make an FTP connection to your Web site and transfer the access.txt file to your docs (or below) directory in the usual manner. Remember to do this in ASCII or Text transfer mode - the file is to be read directly by the server so it must be in Unix format. You now need to rename the file to .htaccess, you should be able to do this from within your FTP client (ignore the next paragraph).

If you cannot rename the file from within your FTP client, or you wish to do this by hand as follows. Once you have copied this to your /docs directory you now need to Telnet to your site, and change the files name to '.htaccess'. Open a Telnet session to your web site, go into the docs directory and type : mv access.txt .htaccess.

If you cannot rename the file from within your FTP client, you will need to rename the file by hand as follows:

  1. Open a Telnet session to your web space,
  2. go into the "/docs" directory
  3. type : mv access.txt .htaccess.

Note: there is a "." in front of htaccess, otherwise this file will not work properly.

Please note, once you rename the file it will not be shown when you use ls to list the directory contents. Instead you can use ls -a or ls -la to see its details.

Once renamed to .htaccess, this will be included in the MIME types applied to your web site. This is recursive within your site, so all files in lower directories also use your new MIME type. If you were to re-define your MIME type in a sub directory this would take precedence over the previous definition from that sub directory down.


Helpdesk Tel: 0845 272 2555 for Commercial Web support
   e-mail: websupport@demon.net
Autoresponder: support@demon.net; Minicom: 0845 272 2445


More Help





*