Hi,
I am having problem getting file passthru working with MSIE 6.0.
I generate a dynamic file based on parameters from a form submission, zip it and then do the following:
$len = filesize($zipfile);
if (strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie 5.5')) {
$att = '';
} else {
$att = 'attachment;';
}
header ('Content-Description: File Transfer');
header ('Content-Type: application/force-download');
header('Content-Type: application/download');
header('Content-type: application/x-zip-compressed');
header ('Content-Length: ' . $len);
header('Content-Disposition: ' . $att . ' filename="' . $zipfile . '"');
$fpdownload = fopen($zipfile, 'rb');
fpassthru($fpdownload);
fclose($fpdownload);
Using Mozilla or Opera it works like a dream so I am sure there is nothing wrong with the file generation itself. But when using MSIE, the browser tries to download the php file itself, not the file I generate (at least that's what it looks like). I've tried readifle instead of fpassthru with identical results.
Any suggestions appreciated.