Knowledgebase
Adding Additional MIME Types
Posted by James Moir on 21 June 2016 04:06 PM

Overview

Whenever content is returned from a web server it includes a MIME Content Type header, which provides information to the client about the type of data which is being returned. Using this header the client is able to determine the best way to handle the content, which may include opening a helper application. For files returned directly from the server the MIME type is defined by the extension of the file.

The following table shows some MIME type examples:

Type / Subtype File Extension
application/msword doc
application/pdf pdf
video/mpeg mpeg
video/x-flv flv
audio/mpeg mp3
image/jpeg jpg
text/html html

Net24 has a predefined server wide list of common MIME types configured on Windows IIS and Unix Apache servers. However if you have files on your site for which a MIME type is not defined, the content of these files may not be displayed correctly by the client.

The predefined list can not be modified, but additional MIME types can be easily added to individual site following the instructions below:

Adding MIME Types Under Unix Hosting Accounts

  1. Determine the MIME type required for the file. A list of registered MIME types and extensions can be found at: http://www.iana.org/assignments/media-types/
  2. Create a .htaccess file with a text editor and add each MIME type using the Apache AddType directive.
    Example:
    AddType application/x-shockwave-flash swf
    

    The AddType tells the server to add a new MIME type. The application/x-shockwave-flash is the actual MIME type and the swf is the extension of the file. You can add as many MIME types as required, simply repeat the line for each MIME type.

  3. Save and upload the .htaccess file to the document root of your site; the new MIME types will active immediately.

Adding MIME Types Under Windows Hosting Accounts

  1. Determine the MIME type required for the file. A list of registered MIME types and extensions can be found at: http://www.iana.org/assignments/media-types/
  2. Login to the Plesk Server Administrator.
  3. Select the domain name you wish to add the MIME type for.
  4. Click on the Web Directories button.
  5. Select the Mime Types tab and enter the new file extension and MIME type and click OK.