NYCPHP Meetup

NYPHP.org

[nycphp-talk] need help!

drydell at att.net drydell at att.net
Tue Jun 8 11:37:05 EDT 2004


Another thing to do is to make sure the client doesn't know how to handle that particular MIME type (such as loading Excel for vnd.ms-excel). One non-existant MIME type that's commonly used is force-download. This is what I do in my download script, which works in most browsers:

  header("Cache-Control: no-store, no-cache, must-revalidate"); 
  header("Cache-Control: post-check=0, pre-check=0", false);
  header("Cache-control: private");
  header("Pragma: no-cache");
  header("Content-Type: application/force-download");
  header('Content-Length: '.strlen($data) );
  header('Content-Disposition: attachment; filename="'.$filename.'"');
  echo $data;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20040608/f731ec03/attachment.html>


More information about the talk mailing list