note 41360 added to function.header
| From: | aaron at gwmicro dot com | Date: | Wed, 07 Apr 2004 17:02:33 +0000 |
| Subject: | note 41360 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67769@lists.php.net to get a copy of this message | ||
Although obvious to most, I was completely oblivious to the fact that file names being used in the
Content-Disposition header can not (or should not) have spaces.
Content-Disposition: attachment; filename=This is a test.mp3
yields the script name as the recommended filename. But
Content-Disposition: attachment; filename=This_is_a_test.mp3
yields "this_is_a_test.mp3" as the recommended filename.
Yeah, I know: big slap to the forehead. As renaming all of the files that I'm serving would
sadden me greatly, a simple str_replace(" ", "_", $filename) before sending the
file off works just fine.
I hope I've helped other simpletons like myself.
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41360
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41360&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41360&report=yes
Search -- http://master.php.net/manage/user-notes.php