fpassthru failure with mozilla
| From: | dthmtluncrn@gmail.com | Date: | Tue, 12 Oct 2004 16:03:37 +0000 |
| Subject: | fpassthru failure with mozilla | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199262@lists.php.net to get a copy of this message | ||
I'm using fpassthru so users must log in to have access to certain
files. The users are accessing the fpassthru script with an https
connection. The code works fine with IE but sends inline ascii text
with mozilla/firefox. The code looks like this:
$filepath = "bla/bla/files/";
$filename = "file.zip";
$fullpath = "$filepath/$filename";
header( ' Pragma: ');
header( ' Content-Type: application/force-download' );
header( ' Content-Type: application/octet-stream ' );
header( ' Content-length:'.(string)(filesize($fullpath)));
header( ' Cache-Control: private' );
header( " Content-Disposition: attachment; filename='$filename'");
$fh = fopen("$filepath/$filename", "rb");
fpassthru($fh);
Any ideas? Everything I've read says with the content type set to
application, and the disposition set to attachment I should be set,
but it doesnt seem to be the case.