From 75b99e85fff200a1fc88eb0b171fc8834a2f085e Mon Sep 17 00:00:00 2001 From: Scott Dutton Date: Fri, 30 Aug 2019 23:49:23 +0100 Subject: [PATCH 1/2] Increase max read 8kb is very low, especially given this will be local files Signed-off-by: Scott Dutton --- lib/private/Files/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 20c0fd3ed1ba7..a5f93b4b73cbc 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -423,7 +423,7 @@ public function readfile($path) { @ob_end_clean(); $handle = $this->fopen($path, 'rb'); if ($handle) { - $chunkSize = 8192; // 8 kB chunks + $chunkSize = 512000; // 500 kB chunks while (!feof($handle)) { echo fread($handle, $chunkSize); flush(); @@ -447,7 +447,7 @@ public function readfilePart($path, $from, $to) { @ob_end_clean(); $handle = $this->fopen($path, 'rb'); if ($handle) { - $chunkSize = 8192; // 8 kB chunks + $chunkSize = 512000; // 500 kB chunks $startReading = true; if ($from !== 0 && $from !== '0' && fseek($handle, $from) !== 0) { From 65e134c13ae5e82b1c31fb2481eb9ebe0962f221 Mon Sep 17 00:00:00 2001 From: Scott Dutton Date: Wed, 15 Apr 2020 19:10:06 +0100 Subject: [PATCH 2/2] Update View.php --- lib/private/Files/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index a5f93b4b73cbc..0453064ae5231 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -423,7 +423,7 @@ public function readfile($path) { @ob_end_clean(); $handle = $this->fopen($path, 'rb'); if ($handle) { - $chunkSize = 512000; // 500 kB chunks + $chunkSize = 524288; // 512 kB chunks while (!feof($handle)) { echo fread($handle, $chunkSize); flush(); @@ -447,7 +447,7 @@ public function readfilePart($path, $from, $to) { @ob_end_clean(); $handle = $this->fopen($path, 'rb'); if ($handle) { - $chunkSize = 512000; // 500 kB chunks + $chunkSize = 524288; // 512 kB chunks $startReading = true; if ($from !== 0 && $from !== '0' && fseek($handle, $from) !== 0) {