Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
October 25, 2006, 10:24 pm
rate this thread
This problem only affects PC IE. On a secured page (a page visited via
https), there is a link that reads -- "Download HTML File". The link
connects to this page
$user_id = $_REQUEST[USER_ID_PARAM];
$file_contents = generateLoginFile($user_id);
header('Content-Length:' . strlen($file_contents));
header('Content-Disposition: attachment; filename="' .
str_replace("%s", getCompanyName($user_id), AUTO_LOGIN_FILE_TITLE) .
However, on Internet Explorer, when I'm prompted to save the file, I
click "Save" and then get an error message stating, "Internet Explorer
cannot download ...ate_login_file.php?UserId=2 from
Internet Explorer was not able to open the Internet site. The
requested site is either unavailable or cannot be found. Please try
Is there something wrong iwth one of the headers I'm sending? I'm
using PHP 4.4.4.
Thanks, - Dave
Re: Internet Explorer 6 refusing to let me download
session_start() by default sends a cache control header including "no-store".
Internet Explorer takes this a bit too literally, but doesn't have appropriate
error handling for the case, and as a result explodes cryptically when you
attempt to save the output page to disk.
Before session_start(), add "session_cache_limiter('none');", or look up that
function and tweak the limiter as appropriate (probably 'private' is closer to
Andy Hassall :: firstname.lastname@example.org :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool