How to get mime type of online files using c#
I am deve开发者_运维知识库loping a url sniffer and i wanted to filter results as i wanted to grab only media files by checking their mime types. I am searching over google for two days now but can't find any correct solution.
IIS just looks at the file extension of a file, and looks it up in an internal database (you can Create/Read/Update/Delete entries).
This isn't 100% accurate (extension doesn't have to match the content), but going a step further would be overkill.
Here's more on mime types.
精彩评论