mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
send downloadfile piece by piece. saves RAM and is better suited for large files.
This commit is contained in:
parent
8ed8d9cd91
commit
c9eaffd336
1 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue