I have been fumbling with my code in order to make a download page that works in both IE and FF. I've figured out, that the problem I'm encountering is because of my "header(Refresh:" function which should redirect to the actual download page. It works fine in FF, however in IE, IE tries to download the refresh url location instead of the actual file??
What I've done, is have a page with downloads. You click on the desired download and are then taken to a "confirmation" page, "your download will begin...blah, blah". If it doesn't, click here.. " That kind of thing. On that confirmation page, I used the "header(Refresh:1 url=" in order to create that effect. Works like a champ in FF, but IE tries the url. If I click on the link, "here" if the download doesn't begin (which accesses the download page directly) it works fine in IE??
Any help would be appreciated.
Here is some of my code:
getApp_ok.php
Code: Select all
header("Refresh: 1; URL=getApp.php?id=$id");Code: Select all
$theFile = "$path" . "$appName"; # combine the path and file
header("Cache-Control: ");# leave blank to avoid IE errors
header("Pragma: ");# leave blank to avoid IE errors
header("Content-Type: ".filetype($theFile));
header("Content-length: ".filesize($theFile));
header("Content-Disposition: attachment; filename=\"".$appName."\"");
@readfile("$theFile");Thanks everyone!
-Mike