From e4043d94a24a78b4939e5136573f938632f24ff1 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 3 Jan 2017 11:43:22 +0100 Subject: [PATCH] ProcessController: improve download link --- application/controllers/ProcessController.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/application/controllers/ProcessController.php b/application/controllers/ProcessController.php index 40d48e0..a19d6e8 100644 --- a/application/controllers/ProcessController.php +++ b/application/controllers/ProcessController.php @@ -375,18 +375,17 @@ class ProcessController extends Controller public function downloadAction() { $bp = $this->loadModifiedBpConfig(); - - header( + $response = $this->getResponse(); + $response->setHeader( + 'Content-Disposition', sprintf( - 'Content-Disposition: attachment; filename="%s.conf";', + 'attachment; filename="%s.conf";', $bp->getName() ) ); - header('Content-Type: text/plain'); + $response->setHeader('Content-Type', 'text/plain'); echo $this->storage()->render($bp); - // Didn't have time to lookup how to correctly disable our renderers - // TODO: no exit :) $this->doNotRender(); }