Location: PHPKode > scripts > PHP File Upload Script > hfile-upload/upload.php
<?php
if ((($_FILES["file"]["type"] == "pdf")|| ($_FILES["file"]["type"] == "text/plain"))
&& ($_FILES["file"]["size"] < 4000))
  {
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Error: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
    echo "<table align=center style='border:1px solid green;'><tr><Td>Upload:</td><td> " . $_FILES["file"]["name"] . "</td></tr>";
    echo "<tr><td>Type:</td><td> " . $_FILES["file"]["type"] . "</td></tr>";
    echo "<tr><td>Size: </td><td>" . ($_FILES["file"]["size"] / 1024) . " Kb</td></tr>";
    echo "<tr><td>Stored in:</td><td> " . $_FILES["file"]["tmp_name"]."</td></tr></table>";
    }
  }
else
  {
  echo "Invalid file";
  }
?>
Return current item: PHP File Upload Script