Can you add Mime Types to IIS programmatically? KBs say no: http://support.microsoft.com/kb/q142558/
This VBS will though: (Update: This guy did essentially the same thing!)
Dim LocalMimeMap, MimeMapDim ExtensionToAdd, MimeTypeToAddDim iConst ADS_PROPERTY_UPDATE = 2Set LocalMimeMap = GetObject("IIS://localhost/MimeMap")MimeMap = LocalMimeMap.GetEx("MimeMap")ExtensionToAdd = InputBox("Extension:","IIS") 'TODO Take this from the Command LineMimeTypeToAdd = InputBox("MIME Type:","IIS") 'TODO Take this from the Command Linei = UBound(MimeMap)+1Redim Preserve MimeMap(i) 'Make it bigger and maintain its contentsSet MimeMap(i) = CreateObject("MimeMap") 'Add onto the endMimeMap(i).Extension = ExtensionToAddMimeMap(i).MimeType = MimeTypeToAddLocalMimeMap.PutEx ADS_PROPERTY_UPDATE,"MimeMap",MimeMap 'Poke it back inLocalMimeMap.SetInfo
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. I am a failed stand-up comic, a cornrower, and a book author.
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.