fpassthru(); corrupts files on win 5.0.4 ??
| From: | Andras Kende | Date: | Sun, 03 Apr 2005 07:11:28 +0000 |
| Subject: | fpassthru(); corrupts files on win 5.0.4 ?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-212098@lists.php.net to get a copy of this message | ||
Hello,
windows 2003 server iis6 with php 5.0.4 isapi...
The following code was working perfectly on 5.0.3
since 5.0.4 upgrade dowloaded files gets corrupted..
Any hint where the problem could be?
Thanks,
Andras Kende
http://www.kende.com/
<?php
$file = $_REQUEST['file'];
$company = $_REQUEST['company'];
$path = "\\\server\ftpserver\\$company\\" . $file;
$size = filesize($path);
header("Cache-Control: ");
header("Pragma: ");
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=\"$file\"");
header("Content-transfer-encoding: binary");
header("Content-length: $size");
$fp=fopen($path, "rb");
fpassthru($fp);
fclose($fp);
?>