|
Home
Adding MIME types IntroductionThe 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 ListThe 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.
The list of defined content-typesA 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.
Adding MIME types to the listAlthough 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:
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:
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
|
©Copyright 2008 THUS
|