note 21331 added to function.header
| From: | rhett at mmind dot net | Date: | Wed, 08 May 2002 20:18:00 +0000 |
| Subject: | note 21331 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30343@lists.php.net to get a copy of this message | ||
if you want to have a link to an mp3 on your website, but don't want quicktime to load it, but
rather download it to your machine, use this php script where $mp3name is the name of the mp3
without the .mp3 extension (do this to keep people from leeching mp3s from your site):
header("Cache-control: private");
header("Content-Type: application/mp3");
header("Content-Disposition: attachment; filename=$mp3name.mp3");
if you want to keep the .mp3 extension on your files on your site, simply take away the .mp3 in the
last line of the script.
--
http://www.php.net/manual/en/function.header.php
http://master.php.net/manage/user-notes.php?action=edit+21331
http://master.php.net/manage/user-notes.php?action=delete+21331
http://master.php.net/manage/user-notes.php?action=reject+21331