Getting the type of file from the ASP.NET FileUpload control?
<p>I want to get the type of file uploaded using the ASP.NET FileUpload control.  When I upload a file, I want to be able to get the type of file uploaded, so I can assign a an icon to the file (such as a word, excel, pdf icon).</p>

<p>Here is the problem, I can't go off the file extension because a file could be called test.xxxxxxxx and be a valid pdf file, or a file might not have an extension.</p>

<p>The other option is to read the content-type, but with some of these appear not to be standard or in a simple to read format such as excel files, so is there another option to determine the file type?</p>
