Re: ms word problems again !!

From: Date: Thu, 16 Oct 2003 11:53:38 +0000
Subject: Re: ms word problems again !!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-166284@lists.php.net to get a copy of this message
At 18:16 15-10-03, you wrote:
I'm trying to send the following header to force ms-word to open a html document header("Content-type: application/msword"); header('Content-Disposition: attachment; filename="invoice.doc"'); it works in Mozilla but NOT in IE.. any ideas as its driving me crazy.. I collected various headers to send a csv file to be opened by excel and though it looks redundant, it seems to work.
All the caching supression seems to be important. --------------------------------------------------------
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");               // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");                                     // HTTP/1.0
header("Content-type: text/csv"); header('Content-Disposition: inline; filename="Aanmeldingen_SENSE_symposium_2003.csv"'); echo $string_csv; ----------------------------and---------------------------- In a previous version I also had to supress the word ;atachment; for the content disposition i think, for MSIE 5.5. Is that your MSIE version? I do not use it anymore. Maybe a google search helps to explain this better than I can. if (strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 5.5")) {$att = "";} else {$att = " attachment;";}

« previous php.general (#166284) next »