title: uploading docx, zip, rar, pdf, ppt, in php
body: <p>I am trying to make file uploading page where docx, zip, rar, pdf, ppt these extensions only allowed to upload here I wrote code about it but its showing invalid file type error
  help to solve it </p>
  
  <pre><code>$allowed_types = array('zip','rar','docx','ppt');
  $tmp = explode(".", $_FILES['file']['name']);
  $ext = end($tmp);
  $upload_dir ="uploads/assignments/";
  if(isset($_FILES['file']) &amp;&amp; $_FILES['file']['name'] !=""){
  if( ($_FILES['file']['type']=="application/zip")
  || ($_FILES['file']['type']=="application/rar")
  || ($_FILES['file']['type']=="'application/docx'")
  || ($_FILES['file']['type']=="application/ppt")
  &amp;&amp; ($_FILES['file']['size']&lt;400000)
  &amp;&amp; in_array($ext,$allowed_types))
  </code></pre>