Posted By

frankyfish on 02/19/07


Tagged

download dynamic


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


download


 / Published in: Other
 

  1. <?php
  2. if(isset($_GET["file"]) && $_GET["file"] != "") {
  3. if(file_exists($_GET["file"])) {
  4. header("Content-type: application/x-download");
  5. header("Content-Length: ".filesize($file));
  6. header('Content-Disposition: attachment; filename="'.basename($_GET["file"]).'"');
  7. readfile($_GET["file"]);
  8. exit();
  9. } else {
  10. exit("File not found");
  11. }
  12.  
  13. } else { exit(); }
  14. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: khader on July 30, 2007

You need to login to post a comment.