размер файла не отображается перед началом загрузки


Вот мой код на php : sample demo capture **Загрузка работала, но размер файла не показывал размер **

$infofile="sample.rar";
header("Content-Description:File Transfer");
header("Content-Type:application/x-rar");
header("Content-Lenght:".(string)filesize($infofile));
header("Content-Disposition:attachment;filename=sample_filename_for_dowload.rar");
header("Expires:0");
header("Cache-Control:must-revalidate,post-check=0,pre=check=0");
header("Progma:public");
ob_clean();
flush();
readfile($infofile);
Author: barnameha, 2013-11-30

1 answers

Возможно, из-за вашей опечатки

Длина содержимого

Должно быть Длиной содержимого http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

 0
Author: G-Man, 2013-11-30 04:31:53