title: How to detect if a file is PDF or TIFF?
body: <p>Please bear with me as I've been thrown into the middle of this project without knowing all the background. If you've got WTF questions, trust me, I have them too.</p>
  
  <p>Here is the scenario: I've got a bunch of files residing on an IIS server. They have no file extension on them. Just naked files with names like "asda-2342-sd3rs-asd24-ut57" and so on. Nothing intuitive. </p>
  
  <p>The problem is I need to serve up files on an ASP.NET (2.0) page and display the tiff files as tiff and the PDF files as PDF. Unfortunately I don't know which is which and I need to be able to display them appropriately in their respective formats. </p>
  
  <p>For example, lets say that there are 2 files I need to display, one is tiff and one is PDF. The page should show up with a tiff image, and perhaps a link that would open up the PDF in a new tab/window.</p>
  
  <p>The problem:</p>
  
  <blockquote>
    <p>As these files are all extension-less I had to force IIS to just serve everything up as TIFF. But if I do this, the PDF files won't display. I could change IIS to force the MIME type to be PDF for unknown file extensions but I'd have the reverse problem.</p>
  </blockquote>
  
  <p><a href="http://support.microsoft.com/kb/326965" rel="noreferrer">http://support.microsoft.com/kb/326965</a></p>
  
  <p>Is this problem easier than I think or is it as nasty as I am expecting?</p>