6
votes

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.

1
The TriDEngine web sites lists a NET framework callable version in addition to the command line version. I am not familiar with the product, but it appears to have what you need - Sparky
Thanks. Even if this is true (and I could not find it), it still lacks the support for the required Stream interface. - wpfwannabe

1 Answers

1
votes

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.