diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-05-01 20:32:13 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-05-02 11:02:13 +0200 |
commit | c9eaffd3363f06137fb197138d0b197679085537 (patch) | |
tree | 4b5e8cccc818b43b5c44bdbb9d1017aa4d26d1f6 /lib/files.php | |
parent | 8ed8d9cd91de8b4c977c1b7c0e7facba4754135e (diff) | |
download | nextcloud-server-c9eaffd3363f06137fb197138d0b197679085537.tar.gz nextcloud-server-c9eaffd3363f06137fb197138d0b197679085537.zip |
send downloadfile piece by piece. saves RAM and is better suited for large files.
Diffstat (limited to 'lib/files.php')
-rw-r--r-- | lib/files.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/files.php b/lib/files.php index a7b83149574..107605fc34e 100644 --- a/lib/files.php +++ b/lib/files.php @@ -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); |