lomerok
09.06.2008, 22:40
нужен скрипт скачки файла на комп...
пробую так :
<?
$downloadfile=$_GET['downloadfile'];
if(isset($downloadfile))
{
if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))
Header('Content-Type: application/force-download');
else
Header('Content-Type: application/octet-stream');
Header('Accept-Ranges: bytes');
//Header('Content-Length: '.filesize($downloadfile));
Header('Content-disposition: attachment; filename="'.$downloadfile.'"');
$downloadfile = getcwd()."\\$downloadfile";
echo file_get_contents("$downloadfile");
exit();
}
?>
нефурычит
пробую так :
<?
$downloadfile=$_GET['downloadfile'];
if(isset($downloadfile))
{
if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))
Header('Content-Type: application/force-download');
else
Header('Content-Type: application/octet-stream');
Header('Accept-Ranges: bytes');
//Header('Content-Length: '.filesize($downloadfile));
Header('Content-disposition: attachment; filename="'.$downloadfile.'"');
$downloadfile = getcwd()."\\$downloadfile";
echo file_get_contents("$downloadfile");
exit();
}
?>
нефурычит