Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: PHP  |  size: 0.67 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $file_name = $_GET['name'];
  3. $file_url = urldecode($_GET['url']);
  4. /*header('Content-Type: application/octet-stream');
  5. header("Content-Transfer-Encoding: Binary");
  6. header("Content-disposition: attachment; filename=\"".$file_name."\"");
  7. readfile($file_url);
  8. exit;*/
  9.  
  10. header('Content-Type: application/octet-stream');
  11. header("Content-Transfer-Encoding: Binary");
  12. header("Content-disposition: attachment; filename=\"".$file_name."\"");
  13. $ch = curl_init();
  14.    
  15. curl_setopt($ch, CURLOPT_HEADER, 0);
  16. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
  17. curl_setopt($ch, CURLOPT_URL, $file_url);
  18.    
  19. $data = curl_exec($ch);
  20. curl_close($ch);
  21. sleep(5);
  22. echo $data;
  23. exit;
  24. ?>