By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,705 Members | 1,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,705 IT Pros & Developers. It's quick & easy.

Download headers for Safari

P: n/a
Hi,

I'm working on an old known problem: A JPG file has to be downloaded (not
shown) in the browser. This is my current code:

header('Content-Type: application/octet-stream');
header('Content-Length:
'.filesize($_REQUEST["filepath"].$_REQUEST["file"]));
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
header('Content-Disposition: attachment;
filename="'.$_REQUEST["file"].'"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment;
filename="'.$_REQUEST["file"].'"');
header('Pragma: no-cache');
}
readfile($_REQUEST["filepath"].$_REQUEST["file"]);
This works fin with IE und Netsc. , Mozilla Linux etc. But not on mac's
safari.
What is the problem, what must i do to force the safari's download.

Regards,
Frank
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.