Main Contents

PHP Force Download :: Fixing Safari Download Header Issues

October 26, 2007

Problem:
We’d got this client requesting a download script written in PHP. The Script should be able to run in Mozilla Firefox, MS IE, and Safari. Sounds simple enough right? I mean this could simply be done by just sending the following headers:

header(“Pragma: public”);
header(“Expires: 0″);
header(“Cache-Control: must-revalidate, post-check=0, pre-check=0″);
header(“Cache-Control: private”,false);
header(“Content-Transfer-Encoding: binary”);
header(“Content-Type: video/x-ms-wmv”);
header(“Content-Length: “.@filesize($filepath));
header(“Content-Disposition: attachment; filename=\””.$filename.“\”;”);

We’ve been using [...]

Filed under: PHP, Safari | Comments (2)
Related Links: