Hi,

Using the below code to force download works fine on most servers and with most
browsers. However it does "crash" Firefox when I download a specific file, IE
works like beauty. File content starts with:

#!/sbin/_joor_perl_use Filter::decrypt......

This is the code to force the download:

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$file\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $size");
$file = fopen($completePath, 'r');

while(ob_get_level()) {
        ob_end_flush();
}

while(!feof($file)) {
        echo fread($file, 2048);
}

fclose($file);

Where can I start? Could it be server config? Or could it have to do with flush?
If I remove the ob_end_flush() it does not crash Firefox.

Best regards,
Peter Lauri

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to