note 14861 deleted from function.header by jimw
| From: | jimw@php.net | Date: | Wed, 31 Oct 2001 22:09:16 +0000 |
| Subject: | note 14861 deleted from function.header by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-19811@lists.php.net to get a copy of this message | ||
I tried passing through a pic with the following code:
header("Content-Disposition: attachment; filename=$picsfilename");
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize($picsurl));
header("Content-Transfer-Encoding: binary");
$fp = fopen("$picsurl", "rb");
print fread($fp, filesize($picsurl));
fclose($fp);
the pic downloaded is somehow corrupted with a few more bytes.
I realized that it works with:
$fn=fopen("$picsurl" , "rb");
fpassthru($fn);
instead.