note 16535 deleted from function.fpassthru by jimw
| From: | jimw@php.net | Date: | Fri, 14 Dec 2001 19:28:49 +0000 |
| Subject: | note 16535 deleted from function.fpassthru by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22667@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);
?>