I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to this question only in .Net.
C# – Using .NET, how can you find the mime type of a file based on the file signature not the extension
cmimemime-types
Related Topic
- C# – Path.Combine for URLs
- C# – Case insensitive ‘Contains(string)’
- Json – the correct JSON content type
- C# – LINQ’s Distinct() on a particular property
- C# – Get int value from enum in C#
- C# – Get MIME type from filename extension
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- C# – JavaScriptSerializer – JSON serialization of enum as string
Best Answer
I did use urlmon.dll in the end. I thought there would be an easier way but this works. I include the code to help anyone else and allow me to find it again if I need it.
...