note 41360 deleted from function.header by betz
| From: | betz@php.net | Date: | Wed, 07 Apr 2004 20:20:46 +0000 |
| Subject: | note 41360 deleted from function.header by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67780@lists.php.net to get a copy of this message | ||
Note Submitter: aaron@gwmicro.com
----
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.