note 75981 added to function.readfile
| From: | ElliottBrueggeman at osu1 dot php dot net | Date: | Mon, 25 Jun 2007 15:47:42 +0000 |
| Subject: | note 75981 added to function.readfile | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127956@lists.php.net to get a copy of this message | ||
I have noticed some unusual behavior with Internet Explorer 6 thatâs worth taking note of. I
have a link on my site to a script that outputs an XML file to the browser with the below code:
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$filename.'"');
@readfile($file);
When the popular IE setting âReuse Window for Launching Shortcutsâ is unchecked (access
this setting in the Tools Menu > Internet Options > Advanced Tab) this script will output the
file to the browser and open it in a different window if the user clicks the open button on the IE
prompt. However, if this setting is checked, and browser windows are being re-used, then it will
open up on top of the page where the link was clicked to access the script.
If I instead set the html link target option to be â_blankâ, the script will open up in a
new window as expected if the âReuse Window for Launching Shortcutsâ is checked. But, if
the setting is unchecked, the output XML file will open up in a new window and there will be another
blank window also open that has the address of the script, in addition to our original window.
This is far from ideal, and there is no way of knowing whether users have this option checked or
not. We are stuck with the distinct possibility of half of our visitors seeing either an annoying
third blank window being opened or the script writing over their original window, depending on their
âReuse Window for Launching Shortcutsâ setting.
----
Server IP: 69.147.83.197
Probable Submitter: 12.3.53.162
----
Manual Page -- http://www.php.net/manual/en/function.readfile.php
Edit -- https://master.php.net/note/edit/75981
Del: integrated -- https://master.php.net/note/delete/75981/integrated
Del: useless -- https://master.php.net/note/delete/75981/useless
Del: bad code -- https://master.php.net/note/delete/75981/bad+code
Del: spam -- https://master.php.net/note/delete/75981/spam
Del: non-english -- https://master.php.net/note/delete/75981/non-english
Del: in docs -- https://master.php.net/note/delete/75981/in+docs
Del: other reasons-- https://master.php.net/note/delete/75981
Reject -- https://master.php.net/note/reject/75981
Search -- https://master.php.net/manage/user-notes.php