Спасибо, но уже разобрался. на php.net нашел и изменил. теперь работает нормально и в осле
$disposition = (!isset($down)) ? "inline" : "attachment";
$type = (!preg_match("/[a-z]+\\/[a-z-]+/i", $attach["content-type"])) ? "application/octet-stream" : $attach["content-type"];
header("Pragma: public");
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: private");
header("Content-Transfer-Encoding: binary");
Header("Content-Type: $type\\r\\n");
Header("Content-Length: ".$size."\\r\\n");
if (strstr($_SERVER[\'HTTP_USER_AGENT\'], "MSIE")) {
$iefilename = preg_replace(\'/\\./\', \'%2e\', $attach["name"], substr_count($attach["name"], \'.\') - 1);
header("Content-Disposition: attachment; filename=\\"$iefilename\\"");
}else{
Header("Content-Disposition: $disposition; filename=\\"".$attach["name"]."\\"\\r\\n");
}
echo $stream;