I have a webpage that has FileUpload control to upload files to server. The FileUpload.ContentType is also saved in database and later used in other procedures.
Now I need an equivalent functionality in my webservice. I get the files from user in byte array. But how should I determine the content type?

I tried using the urlmon.dll. But the results for FileUpload.ContentType and the urlmon.dll are different. The FindMimeFromData of urlmon.dll and FileUpload.ContentType return different values for same file.
e.g. For a .csv file, FindMimeFromData returns "text/plain" while the FileUpload ContentType returns "application/vnd.ms-excel".

Anyone knows of any way to get the same ContentType that is returned from asp.net FileUpload control?