title: Get a file type from the contents and NOT from extension
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1363813/how-can-you-read-a-files-mime-type-in-objective-c">How can you read a files MIME-type in objective-c</a>  </p>
  </blockquote>
  
  
  
  <p>In Cocoa, I am trying to get file type, I.E. JPG, JPEG, or PNG, using </p>
  
  <pre><code>LSCopyKindStringForURL((CFURLRef)URL, (CFStringRef *)&amp;kind);
  </code></pre>
  
  <p>This helps only when the file extension is valid. However, if I rename a PNG file extension to JPEG, it returns JPEG, because LSCopyKindStringForURL returns file type from extension.</p>
  
  <p>Is there any other method that will return me the exact type from the underlying contents of the file?</p>