473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Download headers for Safari

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
0 1672

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brandon Walters | last post by:
I wrote a file download module for my website. The reason for the file download module is that my website downloads work on a credit based system. So I need to keep track of and limit daily...
4
by: kingofkolt | last post by:
im trying to let a user download a file from my website, for example a picture. i dont want the user to have to right-click and do save-as, but instead i want a window to popup (the window with...
13
by: Ken | last post by:
How do I download files from the internet server to my computer? How do I tell the script the correct hard drive folder on my computer to copy the files to? After connecting to the internet...
7
by: Daedalus | last post by:
Hi, I have made a php page where people can configure a javascript online with a preview and then dowload the result. Here is the code: <? // Some code that create a temp file ($file handler =...
6
by: Bryan Martin | last post by:
Ok im trying to figure out how internet explorers file download box always seem to at least come close to knowing the exact file size/time to download. From what I can tell its getting its not...
5
by: Alan Zhong | last post by:
i wonder how to download a webpage automatically using a C# program with WebClient class. i tried it and it's working. but somehow the data it gets is different than the page shown in microsoft...
6
by: aljosa.mohorovic | last post by:
I have a problem when doing indirect download of file through php, when I click on download link Firefox and Internet Explorer give me same options: Open and Save. Firefox opens file directly from...
3
by: mpar612 | last post by:
I am trying to create an area where a user can come to a page that queries a database and displays links to files. Here is the code for the link: <td><a...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.