note 63367 added to function.header
| From: | steve at stevedix dot de | Date: | Tue, 21 Mar 2006 13:39:16 +0000 |
| Subject: | note 63367 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106150@lists.php.net to get a copy of this message | ||
Referring to the infamous Microsoft Explorer bug, particularly when outputting PDF : The problem is
this -
Most well-behaved browsers require a mime-type before they attempt to display anything. If they
don't receive a mime-type from the server, then they revert to text/plain.
Not Microsoft Explorer.
Microsoft Explorer attempts to ascertain what type of file it is recieving by looking in the file
first. You can test this by renaming a graphic file so that it does not have a .extension (ie
rename test.gif to be test), and upload it to your server. Look at it via a URL, and any compliant
browser will render it as text. Not Microsoft Explorer, which renders the file as a graphic.
Unfortunately, this behavior is not consistent.
The really big problem comes with the Adobe postscript plugin. Most browsers will shut up and
listen when given a mime type for PDF. Not Microsoft Explorer. It sees that the url generating the
file contains a .php, and gets confused.
I eventually discovered that the best way to stop this problem was to generate the pdf to a file,
move it to a subdirectory under the htdocs, and then issue a redirect to it. Examples of this
method can be seen in use at www.onvista.de, such as
http://fonds.onvista.de/snapshot.html?ID_INSTRUMENT=6628444
Which launches a separate window, generates the pdf, and then redirects to it.
Naughty, naughty Microsoft browser. No biscuit for you.
----
Server IP: 217.13.201.10
Probable Submitter: 80.135.36.46
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/note/edit/63367
Del: integrated -- http://master.php.net/note/delete/63367/integrated
Del: useless -- http://master.php.net/note/delete/63367/useless
Del: bad code -- http://master.php.net/note/delete/63367/bad+code
Del: spam -- http://master.php.net/note/delete/63367/spam
Del: non-english -- http://master.php.net/note/delete/63367/non-english
Del: in docs -- http://master.php.net/note/delete/63367/in+docs
Del: other reasons-- http://master.php.net/note/delete/63367
Reject -- http://master.php.net/note/reject/63367
Search -- http://master.php.net/manage/user-notes.php