I'm working on a project which requires me to read (with C#) existing SQL Server 2005 'Image' datatype data, making it useful to the end user in an ASP.NET application. The trouble is, the mime type for the data stored in each row is not stored...there isn't an easy way to tell, in advance, if the data I'm pulling out is a pdf, gif, jpg, zip, docx, xml, bmp or some other file type.
Looking closely at the stored data, I noticed that they start with consistent values (headers), and there are only a handful of different headers there.