Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2.  
  3. $fileid = $_GET['fid'];
  4. $name = $_GET['fn'];
  5.  $auth_code = $_GET['dlauth'];
  6. $folder = $_GET['fi'];
  7. echo $file = $folder."/".$name;
  8.  
  9. if (empty($fileid) || empty($name) || empty($auth_code) || empty($folder)) {
  10.    
  11.     echo "Malformed ID, please go back and try to download again";
  12.    
  13.     } else {
  14.        
  15.         if (strlen($auth_code) > 25) {
  16.            
  17.             echo "Download session has expired or is malforned";
  18.            
  19.             }  else {
  20.                
  21.                
  22.              header ("Content-type: image/png");
  23. header ("Content-disposition: attachment; filename=".$name.";");
  24. header("Content-Length: ".filesize($file));
  25. readfile($file);
  26. exit;
  27.  
  28.                
  29.                
  30.                
  31.                
  32.                 }
  33.        
  34.        
  35.    
  36.         }
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement