MIME Types


Multi-purpose Internet Mail Extensions (MIME Types) were originally used so emails could include information other than plain text. They are now referred to as Media Types and are used by web servers to inform web browsers of the type of data that is being sent to them.

The browser uses the Media Type (not the file extension) to determine the type of content to be processed in order to select the proper protocols to handle the data correctly.

Official Media Types

The Internet Assigned Numbers Authority (IANA) is the official authority responsible for Media Types. View the following IANA page for a current list:

Viewing the Media Types on your server

To check which Media Types are already installed on your server, log into your server via SSH. Once logged in, run the following command to view the mime.types file.

[server]$ cat /etc/mime.types

You can also use grep to search for a specific Media Type. For example, if you wanted to check for mpeg, run the following:

[server]$ cat /etc/mime.types | grep mpeg

Adding your own Media Types

You can add your own Media Types to any directory by using an .htaccess file. For example:

AddType video/x-flv flv

AddType is an Apache directive that specifies that you are adding a Media Type. The actual Media Type is then added after it. View the following link for more information on the syntax of a Media Type:

Viewing Media Types in a browser

Open the developer tools menu in your browser to view the Media Type of a file.

Chrome, Firefox, and Safari

  1. Open the Developer Tools menu in your browser.
    Windows: Hold down CTRL + SHIFT and press the letter i. You could also right-click the page and select Inspect from the menu.
    Mac: Hold down Option (Apple Option) + Command (Apple Option) and press the letter i. You could also right-click (Ctrl (Apple Control)+ click) the page and select Inspect from the menu.
  2. Click the Network tab in the Dev Tools menu.
  3. Reload the page you're currently on by clicking the refresh button in your browser, or by pressing F5. A list of all files loaded on the current page displays.
  4. Click any file under the Name column.
  5. Select the Headers tab in the right pane.
    The HTTP Headers display in the right pane. For example, if you click a .png image file, the right pane displays:
    Content-Type: image/png   

See also

DreamHost links

Third-party links

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?