title: How can I determine a file's true extension/type programmatically?
body: <p>I am working on a script that will process user uploads to the server, and as an added layer of security I'd like to know:</p>
  
  <p>Is there a way to detect a file's true extension/file type, and ensure that it is not another file type masked with a different extension?</p>
  
  <p>Is there a byte stamp or some unique identifier for each type/extension?</p>
  
  <p>I'd like to be able to detect that someone hasn't applied a different extension onto the file they are uploading.</p>