Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internet Explorer 7 compatibility issue #4

Open
GoogleCodeExporter opened this issue Apr 11, 2015 · 3 comments
Open

Internet Explorer 7 compatibility issue #4

GoogleCodeExporter opened this issue Apr 11, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

I came across a major compatibility issue with Internet Explorer 7 and
Microsoft Office 2007/3.

Headers sent cause IE to try to open the file inline but for the 90% of
tests the content was corrupted or IE was unable to handle the file.
I fixed the problem changing content disposition header to attachment

header("Content-Disposition: attachment; filename=\"" . $filename . ".xls\"");

and with 2 additional headers that force the browser to not cache the request.
Here's the final piece of code


        // deliver header (as recommended in php manual)
        header("Content-Type: application/vnd.ms-excel; charset=UTF-8");
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Content-Disposition: attachment; filename=\"" . $filename .
".xls\"");

Original issue reported on code.google.com by wep...@gmail.com on 11 Jul 2007 at 12:14

@GoogleCodeExporter
Copy link
Author

Much better. Thank you.

Original comment by ntsc.mic...@gmail.com on 7 May 2008 at 8:42

@GoogleCodeExporter
Copy link
Author

Thanks for this input/fix. I will try to improve the sent header in one of the 
next
version. It's quite difficult to test this in all MS/Office/IE combinations.

Original comment by oliver.s...@gmail.com on 10 Sep 2009 at 4:00

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Outputting to IE over SSL/HTTPS also causes and issue due to it not being able 
to interpret the header correctly.

I added the following additional header to your code :-

header('Pragma: public');

Original comment by stretch2...@hotmail.com on 6 Aug 2010 at 10:37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant