note 26051 deleted from function.header by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 21:35:17 +0000 |
| Subject: | note 26051 deleted from function.header by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55623@lists.php.net to get a copy of this message | ||
Note Submitter: a_alper@yahoo.com
----
Well, I had a slightly different problem. I wanted a page to open in ms word. Problem was when I
used the following:
header("Content-type: application/x-msword");
It would open in textpad, which I have associated to open documents of type .php
Not what I wanted. What I DID want was for the document to open onscreen in word. The webserver
was, of course, giving the filename of the code page on the net, in this case labels.php and the
resultant output was being associated with textpad due to the .php extension, even though the
encoding type was x-msword.''
The fix was quite simple
header("Content-type: application/x-msword");
header("Content-Disposition: filename="labels.doc");
This solved the problem nicely. Without attachment or other declarations, the page opens properly in
word as was the original intent. No download box is generated and word is the application invoked.