Adding Custom MIME types to your site:
MIME stands for Multi-purpose Internet Mail Extensions. MIME types form a standard way of classifying file types on the Internet. Internet programs such as Web servers and browsers all have a list of MIME types, so that they can transfer files of the same type in the same way, no matter what operating system they are working in.
If a file extension is not being recognized by your website, chances are you need to add it's MIME type to your CloudSite. MIME types are setup through IIS Manager. There are two methods to configure MIME types, you may either directly edit your web.config file, or you may make the changes within IIS.
Adding MIME types within IIS:
- Login to your CloudSite through IIS Manager. Instructions for setting up and logging in can be found in our article How to Login to IIS Manager.
- After logging in to IIS Manager, double-click on the MIME types module in the main window of IIS Manager.
- To add a new MIME types, click on Add on the right hand side and type in the file name extension you wish to add (.mp3 for example) and then the MIME type. Click Ok to finish and add the new MIME type to the list.
- To edit or remove a MIME type, highlight the MIME type you wish to edit or remove from the list in the main window. Once highlighted, click on the Remove or Edit button in the menu on the right hand side.
And you are done adding/removing the MIME type via IIS.
Adding a MIME type through your web.config file:
If you prefer to just modify your web.config file to add the MIME types, you may do so using the following process (you will need to modify the examples to meet your needs:
- Download a copy of your current web.config file (the one located within your webroot folder).
- Edit the file in notepad or another editing tool that does not add formatting to the document.
- EXAMPLE 1: For this example, we will say that you are trying to serve some h264 video, and that you need to add MIME types for .mp4 and .m4v files. To do this, add the following code to your web.config file:
- EXAMPLE 2: For this example, we will show how to add Silverlight-related MIME types to your site/application. To do this, add the following code to your web.config file:
- If you need to remove a MIME type using this method, just delete the line in your web.config that specifies the MIME type.
And that is it, your site is now ready to serve the additional file type you specified