note 16535 added to function.fpassthru
| From: | php at awesomebiz dot com | Date: | Sat, 03 Nov 2001 05:12:29 +0000 |
| Subject: | note 16535 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20349@lists.php.net to get a copy of this message | ||
You can use fpassthru to allow users to download files from your site. This is useful if you want to
store your files in a private area and only allow authenticated users to download them.
(This is from a Zend forum thread, submitted by Rainer).
<?
header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=\"abc.zip\"");
$fn=fopen("/home/me/private/abc.zip" , "r");
fpassthru($fn);
?>
--
http://www.php.net/manual/en/function.fpassthru.php
http://master.php.net/manage/user-notes.php?action=edit+16535
http://master.php.net/manage/user-notes.php?action=delete+16535
http://master.php.net/manage/user-notes.php?action=reject+16535