note 63367 deleted from function.header by tularis

From: Date: Fri, 20 Apr 2007 14:34:53 +0000
Subject: note 63367 deleted from function.header by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-125684@lists.php.net to get a copy of this message
Note Submitter: steve at stevedix dot de ---- 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.

« previous php.notes (#125684) next »