note 17693 added to function.header

From: Date: Wed, 19 Dec 2001 23:18:32 +0000
Subject: note 17693 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-23345@lists.php.net to get a copy of this message
To specify a name when the user downloads a file via a php script, DON'T use header("Content-Disposition: attachment; filename=\"filename\"")<br>This header is known to break ie 5.0, 5.5, Konquerer and others (try it for yourself).<br> I suggest the following:<br>Append '/<desired filename>' to the end of the URL that would retrieve the file. So if you're using href="myscript.php", replace that with href="myscript.php/foo.bar" (to have the dialog name the file foo.bar). Then you can leave the 'Content-Disposition' header out entirely. **NOTE: If your href has a GET variable, some browsers will use your script name instead(thus defeating the purpose of this comment). In this case, try to reformat all your variables as if they are sub directories of your script. Then parse the URI with <br>$array_of_vars = split('/', $REQUEST_URI); -- http://www.php.net/manual/en/function.header.php http://master.php.net/manage/user-notes.php?action=edit+17693 http://master.php.net/manage/user-notes.php?action=delete+17693 http://master.php.net/manage/user-notes.php?action=reject+17693

« previous php.notes (#23345) next »