title: PHP MIME Type, limit uploading file
body: <p>I have this code</p>
  
  <pre><code>if(isset($_FILES['uploadfile']))   
      {  
      $maxsize    = 10485760; //10MBx1024
      $acceptable = array(
          'image/jpeg',       
          'image/jpg',
          'image/gif',
          'image/png',
          'application/pdf',
          'text/plain',
          'application/vnd.ms-excel',
          'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
          'application/vnd.ms-word',
          'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
          'application/zip',
          'application/x-zip-compressed',
          'application/x-compressed',
          );
  </code></pre>
  
  <p>and this is the following parts:</p>
  
  <pre><code>if((!in_array($_FILES['uploadfile']['type'], $acceptable)) &amp;&amp; (!empty($_FILES["uploadfile"]["type"]))) 
  {
  $msg= "&lt;b&gt;&lt;img src=redwarn.png'&gt;&lt;font color='red'&gt; This file is not accepted.&lt;/b&gt;&lt;/font&gt;";  
  
  goto cancel; 
  }
  </code></pre>
  
  <p>The above code could limit the extension that user upload, but I tried to upload a IMAGE file, it come out an error that the file wasn't accepted, but I did add <code>'image/jpeg'</code> in the array, is there any error in my code?</p>
  
  <p>Thanks</p>