diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 908302426fa73..8225dc6092b87 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -426,11 +426,11 @@ public function readfile($path) { } $handle = $this->fopen($path, 'rb'); if ($handle) { - $chunkSize = 524288; // 512 kB chunks + $chunkSize = 524288; // 512 kiB chunks while (!feof($handle)) { echo fread($handle, $chunkSize); - $this->checkConnectionStatus(); flush(); + $this->checkConnectionStatus(); } fclose($handle); return $this->filesize($path); @@ -496,7 +496,7 @@ public function readfilePart($path, $from, $to) { private function checkConnectionStatus(): void { $connectionStatus = \connection_status(); - if ($connectionStatus !== 0) { + if ($connectionStatus !== CONNECTION_NORMAL) { throw new ConnectionLostException("Connection lost. Status: $connectionStatus"); } }