download: prevent buffer/gzip

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/602/head
Varun Patil 2023-04-21 10:52:42 -07:00
parent 0aa822c5e4
commit 5e0af5a2e9
1 changed files with 5 additions and 0 deletions

View File

@ -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');