#18675748 10MB 이상의 대용량 파일은 fpassthru 대신 fread를 사용하도록 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8111 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-02-18 04:53:21 +00:00
parent 9e39a22f16
commit b230d45a71

View file

@ -230,7 +230,13 @@
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Content-Transfer-Encoding: binary\n");
fpassthru($fp);
// if file size is lager than 10MB, use fread function (#18675748)
if (filesize($uploaded_filename) > pow(1024, 10240)) {
while(!feof($fp)) echo fread($fp, 1024);
fclose($fp);
} else {
fpassthru($fp);
}
// 이상이 없으면 download_count 증가
$args->file_srl = $file_srl;