You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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
Original issue reported on code.google.com by
wep...@gmail.com
on 11 Jul 2007 at 12:14The text was updated successfully, but these errors were encountered: