title: finfo_file() returns wrong mime type for some images?
body: <p>I allow image uploads on my website and need to get the file types of uploaded files so that I can check to see if the type is whitelisted and allowed to be uploaded. </p>
  
  <p>I've been doing this by using <code>finfo_file()</code>, but it doesn't seem to work in all cases. Here's my code:</p>
  
  <pre><code>// get the mime type
  $finfo = finfo_open(FILEINFO_MIME_TYPE);
  $mime  = finfo_file($finfo, $filePath);
  echo $mime;
  </code></pre>
  
  <p><a href="http://ecx.images-amazon.com/images/I/41q8koaxM0L.jpg" rel="nofollow">http://ecx.images-amazon.com/images/I/41q8koaxM0L.jpg</a></p>
  
  <p>Try running the above code on the image above and it will say the MIME type is <code>application/octet-stream</code> when it is clearly a JPG file.</p>
  
  <p>Why is <code>finfo_file()</code> not working with the test image? How can I fix whatever the problem is so that I can accurately get the file type?</p>