Page 1 of 1

Adding MIME type in IIS

Posted: Wed Nov 18, 2015 1:43 am
by AdrianGray
I need to ascertain if a virtual IIS folder has a particular MIME type. I can get a site list, and from there ascertain the folder. What I am unable to do is get a list of the registered MIME types to check to see if the one I require is already present. How do you go about this, and if it is not present, how do I add it. Thanks, Adrian.

Re: Adding MIME type in IIS

Posted: Wed Nov 18, 2015 1:12 pm
by FrancescoT
Dear Adrian,

I am not an IIS expert, but you can use the "Evaluate XPath Query" command to query the defined MIME Types within the relative portion of the "applicationHost.config" file.

Then to ADD or to EDIT a MIME TYPE, from the install script you can use a call to the "APPCMD" tool (via Run Program command).
https://technet.microsoft.com/en-us/library/cc725608(v=ws.10).aspx

Anyway for what I see, it may be not necessary to query for the defined types. If the type already exists, the "APPCMD" call will ignore the request.

Hope this helps you.

Regards