There are possibilities of an .exe file being renamed to a .txt file to bypass any file type validations. I am looking for a way to find out the actual file type by reading the header of a file without using dlls like urlmon.dll.
MimeMapping.GetMimeMapping doesn't solve the problem, it just extracts the mime type based on the extensions.
Is there a dictionary which says what combinations of bytes represents atleast the very common file types such as txt, doc, docx, pdf, xls or xlsx , an exe etc?