Posted By

uilgenstein on 10/14/10


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Force download (CSV) file

 / Published in: PHP

  1. header("Pragma: public");
  2. header("Expires: 0");
  3. header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  4. header("Cache-Control: private",false); // required for certain browsers
  5. header("Content-type: application/csv");
  6. header("Content-Disposition: filename=\"filename.csv\";");
  7. header("Content-Transfer-Encoding: binary");

Report this snippet  

You need to login to post a comment.