johnmahugu

php - file downloader

Jun 25th, 2015
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(-1);
  4.  
  5. if (isset($_GET["getit"])) {
  6.     header('Content-type: text/plain');
  7.     header('Content-Disposition: attachment; filename="kesh.txt"');
  8.     print("This file was downloaded using the browser!");
  9.     exit();
  10. }
  11.  
  12. ?>
  13.  
  14. <a href="index.php">Go back to index</a>
  15. | <a href="<?php echo $_SERVER["REQUEST_URI"];?>">Refresh</a>
  16.  
  17.  
  18. <h1>Download</h1>
  19.  
  20. <p>You can disable ability to download files by setting
  21. the "enable_downloads" option to false in settings.json.</p>
  22.  
  23. <p>
  24.     Download file:
  25.     <a href="download.php?getit=1">kesh.txt</a>
  26. </p>
Add Comment
Please, Sign In to add comment