Mail Beyond Logo
Posts
Comments

When trying to download a file that is auto-generated on the fly by a PHP script I wrote that sends excel headers, Internet Explorer users were getting the error:

Windows Internet Explorer
Internet Explorer cannot download [filename] from [website].
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.

This is caused by doing a session_start(). If you don’t actually need a the session in your php file you can remove it, and IE users will be able to download whatever your PHP script is making. The problem is session_start() by default sends a cache control header including “no-store”. Internet Explorer has a bug with sending a cache header.

If you need the session, then before session_start(), add “session_cache_limiter(’none’);”

Problem solved!

If you found this helpful, help me by checking out the ads on the right. Thank you!


Link to this post! Copy and paste this code into your blog or website:
<a href="http://www.mailbeyond.com/php-download-causes-error-in-internet-explorer-7-only-not-firefox"> PHP file download error in Internet Explorer 7 </a>

Trackback URI | Comments RSS

Leave a Reply