can PHP deliver files outside the webroot?
| From: | Derek Sivers | Date: | Sun, 19 Nov 2000 03:15:47 +0000 |
| Subject: | can PHP deliver files outside the webroot? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26097@lists.php.net to get a copy of this message | ||
Can I use PHP to send web-users files that exist outside the webroot?
More specifically:
I want authorized users to be able to download MP3 files (yes they're legal) that I keep stored outside the Apache webroot, so that people can only play/download them if the PHP script has authorized them.
PHP world-seeable file:
/www/htdocs/downloadit.php
Secured files at:
/home/secure/mysongname.mp3
What should I use?
Header?
Readfile?
Include/Require?
Fopen?
Thanks!