Php I';我开始下载,未知大小

Php I';我开始下载,未知大小,php,file,download,Php,File,Download,我开始使用PHP下载以下代码: <? $_REQUEST['file'] = urldecode($_GET['file']); header("Content-type: application/x-file-to-save"); header("Content-Disposition: attachment; filename=".$_REQUEST['file']); readfile($_REQUEST['file']); ?> 它的工作,但下载是未知的大小和没有埃塔

我开始使用PHP下载以下代码:

<?
$_REQUEST['file'] = urldecode($_GET['file']);

header("Content-type: application/x-file-to-save");
header("Content-Disposition: attachment; filename=".$_REQUEST['file']);
readfile($_REQUEST['file']);
?>

它的工作,但下载是未知的大小和没有埃塔

我怎样才能修好它

谢谢

header("Content-length: ". filesize($_REQUEST['file']));