daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.   if ($_FILES["file"]["error"] > 0)
  4.     {
  5.     echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
  6.     }
  7.   else
  8.     {
  9.     echo "Upload: " . $_FILES["file"]["name"] . "<br />";
  10.     echo "Type: " . $_FILES["file"]["type"] . "<br />";
  11.     echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
  12.     echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
  13.  
  14.     if (file_exists("upload/" . $_FILES["file"]["name"]))
  15.       {
  16.       echo $_FILES["file"]["name"] . " already exists. ";
  17.       }
  18.     else
  19.       {
  20.       move_uploaded_file($_FILES["file"]["tmp_name"],
  21.       "upload/" . $_FILES["file"]["name"]);
  22.       echo "Stored in: " . "/var/www/upload/" . $_FILES["file"]["name"];
  23.       }
  24.     }
  25.  
  26.  
  27. ?>
RAW Paste Data
Top