note 58981 deleted from function.header by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 09:44:11 +0000 |
| Subject: | note 58981 deleted from function.header by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106705@lists.php.net to get a copy of this message | ||
Note Submitter: amurgshere at hotmail dot com
----
I found that these headers work best for me when trying to foward downloaded content:
import_request_variables("G");
$urldir = $_GET['urldir']; // directory of file to download
$filename = $_GET['filename']; // filename only
$downloadurl = $urldir . $filename;
$size = filesize($downloadurl);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment;
filename=\"".$filename."\";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$size);
readfile($downloadurl);