There are often some special MIME types that are not in IIS and are generally added manually by ourselves. If the site frequently changes the server or the site code is provided to multiple users, it will cause the special MIME type used in the site to be regularly configured on IIS. Given the commonality of a Web site configuration, we can add MIME types to the ASP. NET site configuration file so that users don't have to configure IIS all the time.
In general, we are configuring this part of the MIME information in the Staticcontent node of the system.webserver node, as long as the fileextension file extension attribute in the MimeMap node is set and MimeType this MIME type property (Click this link Common MIME types).
The approximate code is as follows (the extensions and MIME types added in the code are just examples):
<system.webServer> <staticContent> <remove fileextension=". Woff"/> <remove fileextension=". XAP"/> <remove fileextension=". xaml"/> <remove fileextension=". apk"/> <mimemap fileextension=". Woff"Mimetype="Font/x-font-woff"/> <mimemap fileextension=". XAP"Mimetype="Xapapplication/x-silverlight"/> <mimemap fileextension=". xaml"Mimetype="Application/xaml+xml"/> <mimemap fileextension=". apk"Mimetype="application/vnd.android.package-archive"/> </staticContent> </system.webServer>
How to add MIME types to the Web. config configuration file in ASP.