Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. DATA HOSTED WITH ♥ BY PASTEBIN.COM - DOWNLOAD RAW - SEE ORIGINAL
  2. <?php
  3.  
  4. $secret_key = "9ge9ag99135213tgedavxgfedsaxeg"; //Set this as your secret key, to prevent others uploading to your server.
  5. $sharexdir = "i/"; //This is your file dir, also the link..
  6. $domain_url = 'http://domain.com/';
  7. $lengthofstring = 5; //Length of the file name
  8.  
  9. function RandomString($length) {
  10.     $keys = array_merge(range(0,9), range('a', 'z'));
  11.  
  12.     for($i=0; $i < $length; $i++) {
  13.         $key .= $keys[mt_rand(0, count($keys) - 1)];
  14.     }
  15.     return $key;
  16. }
  17.  
  18. if(isset($_POST['secret']))
  19. {
  20.     if($_POST['secret'] == $secret_key)
  21.     {
  22.         $filename = RandomString($lengthofstring);
  23.         $target_file = $_FILES["sharex"]["name"];
  24.         $fileType = pathinfo($target_file, PATHINFO_EXTENSION);
  25.  
  26.         if (move_uploaded_file($_FILES["sharex"]["tmp_name"], $sharexdir.$filename.'.'.$fileType))
  27.         {
  28.             echo $domain_url.$sharexdir.$filename.'.'.$fileType;
  29.         }
  30.             else
  31.         {
  32.            echo 'File upload failed - CHMOD/Folder doesn\'t exist?';
  33.         }  
  34.     }
  35.     else
  36.     {
  37.         echo 'Invalid Secret Key';
  38.     }
  39. }
  40. else
  41. {
  42.     echo 'No post data recieved';
  43. }
  44. ?>