title: Some files are set as "application/octet-stream" type
body: <p>I have weird problem, that when I try to upload different files, some of them are recognized correctly, but some are not and are set as <code>application/octet-stream</code> when you check their type <code>$_FILES['file_1']['type']</code></p>
  
  <pre><code>Debug Objects: png
  Debug Objects: image/png
  Debug Objects: php
  Debug Objects: application/octet-stream
  Debug Objects: rar
  Debug Objects: application/octet-stream
  Debug Objects: psd
  Debug Objects: application/octet-stream
  </code></pre>
  
  <p>I contacted my hosting company, they told me its not an error on their side and that it might be related to CloudFlare, but I never had such problem before.</p>
  
  <p>I know that RAR has <code>application/octet-stream</code> as one of possible mime types, but not PHP or PSD.</p>
  
  <p>Those are types for PSD:</p>
  
  <pre><code>application/x-photoshop
  image/vnd.adobe.photoshop
  </code></pre>
  
  <p>And those are for PHP:</p>
  
  <pre><code>application/x-httpd-php
  application/php
  application/x-php
  text/php
  text/x-php
  application/x-httpd-php-source
  </code></pre>
  
  <p>Does somebody have idea why its doing this? I tried it in IE, FireFox, Chrome and Opera. Happens in all of those browsers.</p>
  
  <p>Is there better way of checking for types? As the ones I am checking are sent by browser, which can be spoofed (I am also checking for extensions for more security). I know there is way to do it with java, but I would like to use PHP and do it server side.</p>
  
  <p>Thanks.</p>