A few times in the last couple months I had the same task of verifying the file format by it’s header: JPEG, PDF, Word, and other popular files.
I wonder if there is a library availble for C#/.Net to do that?
Or is it a time to start a small project for NuGet catalogue?
For those who will find this question in the future: I have started to write the library. Once I have significant amount of different types, I’ll submit it to NuGet. But at the moment the source code is available here: http://filetypedetective.codeplex.com/
The idea of the library is to be able to call
isPdf()orisZip()onFileInfoobjects:etc.
Update: the finally got around to create nuget package: