Skip to content
Snippets Groups Projects
Commit c9eaffd3 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

send downloadfile piece by piece. saves RAM and is better suited for large files.

parent 8ed8d9cd
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,14 @@ class OC_Files {
}
@ob_end_clean();
if($zip){
readfile($filename);
$handle=fopen($filename,'r');
if ($handle) {
$chunkSize = 8*1024;// 1 MB chunks
while (!feof($handle)) {
echo fread($handle, $chunkSize);
flush();
}
}
unlink($filename);
}else{
OC_Filesystem::readfile($filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment