title: upload every kind of video file to public_html
body: <p>How can I allow users to upload every kind of video file to public_html? I'm using this code but it only allows me to upload mp4 video and not mov or 3gp. How can I get it to work</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  include('config.php');
  $allowedExts = array("jpg", "jpeg", "gif", "png", "mov", "mp4", "3gp", "ogg");
  $extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
  
  if ((($_FILES["file"]["type"] == "video/mov")
  || ($_FILES["file"]["type"] == "video/mp4")
  || ($_FILES["file"]["type"] == "video/3gp")
  || ($_FILES["file"]["type"] == "video/ogg")
  || ($_FILES["file"]["type"] == "image/gif")
  || ($_FILES["file"]["type"] == "image/jpeg")
  || ($_FILES["file"]["type"] == "image/png"))
  
  &amp;&amp; ($_FILES["file"]["size"] &lt; 999999999)
  &amp;&amp; in_array($extension, $allowedExts))
  
  {
  if ($_FILES["file"]["error"] &gt; 0)
  {
  echo "Return Code: " . $_FILES["file"]["error"] . "&lt;br /&gt;";
  }
  else
  {
  echo "Upload: " . $_FILES["file"]["name"] . "&lt;br /&gt;";
  echo "Type: " . $_FILES["file"]["type"] . "&lt;br /&gt;";
  echo "Size: " . ($_FILES["file"]["size"] / 999999999) . " Kb&lt;br /&gt;";
  echo "Temp file: " . $_FILES["file"]["tmp_name"] . "&lt;br /&gt;";
  
  if (file_exists("upload/" . $_FILES["file"]["name"]))
    {
    echo $_FILES["file"]["name"] . " already exists. ";
    }
   else
    {
    move_uploaded_file($_FILES["file"]["tmp_name"],
    "upload/" . $_FILES["file"]["name"]);
    // If file has uploaded successfully, store its name in data base
  
    echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
    }
    }
    }
    else
    {
    echo "Invalid file";
    }
    ?&gt;
  </code></pre>