RE: [PHP] force PHP to display download box
| From: | Brant M. Fagan | Date: | Sun, 09 Jul 2000 22:14:31 +0000 |
| Subject: | RE: [PHP] force PHP to display download box | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5653@lists.php.net to get a copy of this message | ||
Here is a script I use.
<?php
$fp = fopen("files/$dir/$store_name", "r");
$contents = fread($fp, filesize("files/$dir/$store_name"));
fclose($fp);
header("Content-type: application/RFC822");
header("Content-Disposition: attachment; filename=$filename");
print($contents);
exit;
?>
--Brant
+--------------------------------------------------+
| Brant M. Fagan |
| Sr. Developer |
| The Shoreline Group, LLC |
| bfagan@theshorelinegroup.com |
+--------------------------------------------------+
| Intended weirdness is above logical criticism. |
| -- J. Scott Campbell |
+--------------------------------------------------+