From 5e0af5a2e91796a14c765e7607c049f39e21ccac Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Fri, 21 Apr 2023 10:52:42 -0700 Subject: [PATCH] download: prevent buffer/gzip Signed-off-by: Varun Patil --- lib/Controller/DownloadController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Controller/DownloadController.php b/lib/Controller/DownloadController.php index dea6495b..6206fef0 100644 --- a/lib/Controller/DownloadController.php +++ b/lib/Controller/DownloadController.php @@ -187,6 +187,11 @@ class DownloadController extends GenericApiController // Make sure the browser downloads the file $out->setHeader('Content-Disposition: attachment; filename="'.$file->getName().'"'); + // Prevent output from being buffered + $out->setHeader('Content-Encoding: none'); + $out->setHeader('X-Content-Encoded-By: none'); + $out->setHeader('X-Accel-Buffering: no'); + // Open file to send $res = $file->fopen('rb');