I need a file type identification NET library (best 100% managed) with a similar functionality to TrIDEngine. I would ultimately need to pass a Stream
representing content and expect the return value as either a MIME type or some enum/string easily mapped to a MIME type.
I want to detect just a handful of media types like WMV, WAV, MP3 and common image formats like JPEG, PNG, GIF and BMP.
The problem with TrIDEngine is the fact that it appears to only come in a form of a command line utility and expects a physical file path, not the required Stream
.
MIME detection This uses the GNU file utility to determine the type of the file, which should work right away under Linux. Note that the file utility provided by other Unixes may not support the -i option, and will thus not work.
MIME stands for "Multipurpose Internet Mail Extensions." It is a standard way of classifying file types on the Internet. By specifying a MIME type, application can easily identify the type of file and can extract more information and attributes about a file.
To Solve MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled ErrorJust make Sure Your File name and the name You are Using in Link Tag Both Are Same. For Example my File name is style. css Then My Link tag is Something like this:<link rel=”stylesheet” href=”style.
If you just need to detect a few file types you could lookup the format on Wikipedia and check for the header or "magic" bytes yourself. You can usually identify a file type from the first few bytes, so you can read a few bytes from the stream and check them yourself. Not exactly what you're asking for, but it shouldn't be too hard for only a few types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With