1
문제점이 있습니다. 이미지를 Zip 파일로 압축 한 다음 다운로드 할 Zip 파일을 강제 실행하는 PHP 스크립트가 있습니다. 이제 내 문제는 얼마나 많은 공간이 다운로드되었는지 IE에 표시되지 않는다는 것입니다. 예 : 2MB는 20MB 중 ..... 15 초 남았습니다. Firefox는 완벽하게 작동합니다. 주석에서 언급 한 바와 같이PHP 강제 파일 다운로드. 다운로드 된 공간의 양을 표시하지 않음
내 코드
header("Content-Disposition: attachment; filename=" . urlencode($zipfile));
header("Content-Type: application/x-zip-compressed");
header("Content-Description: File Transfer");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename));
$fd = fopen($filename,'r');
$content = fread($fd, filesize($filename));
print $content;
IE에서 작동하지 않는 이유는 모르겠지만 다른 메모에서는 fopen/fread 대신 readfile ($ filename)을 사용해야합니다. 파일을 보내기 전에 전체 파일을 메모리에 버퍼링하지 않으므로 훨씬 더 메모리 친숙합니다. –