Advertisement
Shad0w

Untitled

Nov 5th, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. <?php
  2. @$file = $_GET["file"];
  3. $file = str_replace("..", "", $file);
  4. if (file_exists($file)) {
  5.     header('Content-Description: File Transfer');
  6.     header('Content-Type: application/octet-stream');
  7.     header('Content-Disposition: attachment; filename='.basename($file));
  8.     header('Content-Transfer-Encoding: binary');
  9.     header('Expires: 0');
  10.     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  11.     header('Pragma: public');
  12.     header('Content-Length: ' . filesize($file));
  13.     ob_clean();
  14.     flush();
  15.     exit;
  16. }
  17. ?>
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement