I was using urlmon to find the MIME of files however it didnt go well when i couldn't get the correct mime of css files and more SWFs. What can i use to get the file mime?
+1
A:
Hmm, I am not sure I completely understand your question, but if you want to do some sort of look up against a master list you can look at the IIS Metabase
using (DirectoryEntry directory = new DirectoryEntry("IIS://Localhost/MimeMap")) {
PropertyValueCollection mimeMap = directory.Properties["MimeMap"];
foreach (object Value in mimeMap) {
IISOle.MimeMap mimetype = (IISOle.MimeMap)Value;
//use mimetype.Extension and mimetype.MimeType to determine
//if it matches the type you are looking for
}
}
Bob
2009-07-01 02:10:16
arg, i dont have a server ATM.
acidzombie24
2009-07-01 02:57:39