Posted By

rickygri on 02/23/12


Tagged

php download


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

guillermoj88gmailcom


Force downloadable


 / Published in: PHP
 

Force downloadable file with php

  1. <?php
  2.  
  3. //Link to download file with <a href="download.php" target="_blank">Download</a>
  4.  
  5. header('Content-disposition: attachment; filename=huge_document.pdf');
  6. header('Content-type: application/pdf');
  7. readfile('huge_document.pdf');
  8. ?>

Report this snippet  

You need to login to post a comment.