2014-05-21 4 views
0

S3에 0 바이트를 보여주는 다운로드 파일 ...내가 이런 식으로 ... PHP 코드에서 다운로드 file.And에 완전한 권한을 부여했다

while (ob_get_level() > 0) { 
    ob_end_clean(); 
} 
header("Content-Disposition: attachment; filename=" . urlencode(basename($filepath)), true); 
header("Content-Transfer-Encoding: Binary", true); 
header("Content-Type: application/force-download", true); 
header("Content-Type: application/octet-stream", true); 
header("Content-Type: application/download", true); 
header("Content-Description: File Transfer", true); 
header("Content-Length: " . filesize($filepath), true); 
flush(); 

$fp = fopen($filepath, "r"); 
while (!feof($fp)) { 
    echo fread($fp, 65536); 
    // ob_clean(); 
    flush(); 
} 
fclose($fp);  

그러나 다운로드 한 파일은 zerobytes.Im을 보여주고있다 이것은 당신이

답변

1

코드에 라인 아래에 의견을 주시기 바랍니다 도울 수에 대한 완벽한 답을 다시

헤더를 시도 할 수 없습니다. ("콘텐츠 길이를 :"파일 크기 ($ 파일 경로), TRUE);