note 72544 added to function.header

From: Date: Tue, 23 Jan 2007 22:59:01 +0000
Subject: note 72544 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-122089@lists.php.net to get a copy of this message
Filenames in the browser's download dialog can be a bit problematic, when it contains spaces or non-ASCII characters. Firefox cuts at space, To set the appropriate cross-browser header, use the following code. It is assumed that the script receives a query like this: download.php?source=/content/példa fájl.doc <?php $filename = basename($_GET['source']); $ie = eregi("msie", $_SERVER['HTTP_USER_AGENT']); if ($ie) $filename = rawurlencode($filename); /* ... */ header("Content-Disposition: attachment; filename=\"$filename\""); ?> ---- Server IP: 195.56.193.13 Probable Submitter: 80.98.202.194 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/72544 Del: integrated -- https://master.php.net/note/delete/72544/integrated Del: useless -- https://master.php.net/note/delete/72544/useless Del: bad code -- https://master.php.net/note/delete/72544/bad+code Del: spam -- https://master.php.net/note/delete/72544/spam Del: non-english -- https://master.php.net/note/delete/72544/non-english Del: in docs -- https://master.php.net/note/delete/72544/in+docs Del: other reasons-- https://master.php.net/note/delete/72544 Reject -- https://master.php.net/note/reject/72544 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#122089) next »