Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. if ((($_FILES["file"]["type"] == "image/gif")
  3. || ($_FILES["file"]["type"] == "image/jpeg")
  4. || ($_FILES["file"]["type"] == "image/pjpeg")
  5. || ($_FILES["file"]["type"] == "image/jpg")
  6. || ($_FILES["file"]["type"] == "image/x-png")
  7. || ($_FILES["file"]["type"] == "image/png"))
  8.  
  9. && ($_FILES["file"]["size"] < 20000000000))
  10.   {
  11.   if ($_FILES["file"]["error"] > 0)
  12.     {
  13.     echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
  14.     }
  15.   else
  16.     {
  17.     echo "Upload: " . $_FILES["file"]["name"] . "<br />";
  18.     echo "Type: " . $_FILES["file"]["type"] . "<br />";
  19.     echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
  20.     echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
  21.  
  22.     if (file_exists("images/" . $_FILES["file"]["name"]))
  23.       {
  24.       echo $_FILES["file"]["name"] . " already exists. ";
  25.       }
  26.     else
  27.       {
  28.       move_uploaded_file($_FILES["file"]["tmp_name"],
  29.       "images/" . $_FILES["file"]["name"]);
  30.       echo "Stored in: " . "images/" . $_FILES["file"]["name"];
  31.       }
  32.     }
  33.   }
  34. else
  35.   {
  36.   echo "Invalid file";
  37.   }
  38. ?>