From 1cb158c742afe255bddfd81b6eae5af2aa1f1ff4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 25 Feb 2020 08:02:04 -0600 Subject: [PATCH] Revert "[6.x] Fix memory usage on downloading large files (#31163)" (#31587) This reverts commit f239c07cacb3d77daa3e6226ddc15547ddbf4795. --- src/Illuminate/Filesystem/FilesystemAdapter.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index fa101ecef140..ddb6d0f66779 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -163,11 +163,7 @@ public function response($path, $name = null, array $headers = [], $disposition $response->setCallback(function () use ($path) { $stream = $this->readStream($path); - - while (! feof($stream)) { - echo fread($stream, 2048); - } - + fpassthru($stream); fclose($stream); });