Здравствуйте, Beholding, Вы писали:
B>Добавить в заголовок ответа WEB сервера следующую строку:
B>B>Content-Disposition: attachment; filename=myfilename.ext
B>
Есть скрипт savefile.php. Ему скармливается путь к файлу вот так: savefile.php?path=myfile.ext. Opera сохраняет нормально. А IE вместо имени файла берёт просто savefile. Как это побороть?
<?php
function GetContentType($path)
{
$obj = apache_lookup_uri($path);
return $obj->content_type;
}
$name = $_GET['path'];
$type = "Content-type:\"" .GetContentType($name) ."\"";
$dis = "Content-Disposition: attachment; filename=\"" .$name ."\"";
header($type);
header($dis);
readfile($name);
?>