Advertisement
Avatar_Fearless

Upload Script

Mar 26th, 2012
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.26 KB | None | 0 0
  1. //////////////////////////////////
  2. ////////////Coded by. LSS////////
  3. //////////////& Error///////////
  4. /////UnderGround Hackers Team//
  5. //////////////////////////////
  6.  
  7.  
  8.  if(isset($_POST["submit"])) {
  9.                             #
  10.                           # Start uploading the picture.
  11.                           #
  12.    
  13.                             //File informations
  14.                             $name     = $_FILES["file"]["name"];
  15.                             $time     = time();
  16.                             $filetype = $_FILES["file"]["type"];
  17.                             $filesize = $_FILES["file"]["size"];
  18.                             $error    = 0;
  19.                             //Begin validating the upload
  20.                             if(empty($_FILES["file"])){
  21.                                 error("You Forgot To Fill the required Feild Please Fix The Error");
  22.                                 $error++;
  23.                             }
  24.                             if(!in_array($filetype , $allowed)){
  25.                                 error("Unexpected File Format Only Images Supported");
  26.                                 $error++;
  27.                             }
  28.                             if($filesize > $maxsize){
  29.                                 error("File is to large. maximum is " . convertBytes($maxsize));
  30.                                 $error++;
  31.                             }
  32.                             if($error==0) {                            
  33.                                 //Image file name
  34.                                 $filename = $time."_".$name; //.$_FILES["file"];
  35.                                 $file = $filename;
  36.                                 //Upload the picture.
  37.                               //  $upload = move_uploaded_file($_FILES["file"]["tmp_name"] ,"$directory/$file");
  38.                                 echo "<br /><span class='succes'>SUCCESS: </span>Image successfully uploaded";
  39.                                 echo "<br />Copy this link to share image:";
  40.                                 echo "<form>";
  41.                                 echo "<input type='text' name='link' id='link' class='linkcontainer' value='http://www.justrehhoff.org/projekter/mosaik/uploads/$filename'>";
  42.                                 echo "</form>";
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement