How to define MIME type in IIS for specific extension?

Question: How to define MIME type in IIS for specific extension?

Solution:
To define a MIME type for a specific extension, follow these steps:

  1. Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Properties.
  2. Click MIME Types.
  3. Click New.
  4. In the Extension box, type the file name extension that you want (for example, .pdb).
  5. In the MIME Type box, type application/octet-stream.
  6. Apply the new settings. Note that you must restart the World Wide Web Publishing Service or wait for the worker process to recycle for the changes to take effect. In this example, IIS now serves files with the .pdb extension.

If you want to serve all files regardless of the file name extension (for example, if you cannot predict all files that will be served), follow these steps to add a wildcard character mapping:

Note: You should only add the wildcard mapping to the IIS MIME map as a temporary solution during troubleshooting. After you have determined that a missing MIME type is the cause of the issue, remove the wildcard mapping and add the specific mapping for the MIME type that you need to serve.

  1. Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Properties.
  2. Click MIME Types.
  3. Click New.
  4. In the Extension box, type an asterisk (*).
  5. In the MIME Type box, type application/octet-stream.
  6. Apply the new settings. Note that you must restart the World Wide Web Publishing Service or wait for the worker process to recycle for the changes to take effect.

Note: In addition to making these changes at the global level in IIS, you can add necessary MIME types at lower levels in the metabase. When you do this, you can specify the sites or directories that are permitted to serve content with a specific file name extension instead of globally allowing all sites to serve that extension.

 

Add Feedback