diff --git a/src/nk/DocumentBundle/Controller/FileController.php b/src/nk/DocumentBundle/Controller/FileController.php index 851c3c6..224b3a5 100644 --- a/src/nk/DocumentBundle/Controller/FileController.php +++ b/src/nk/DocumentBundle/Controller/FileController.php @@ -82,14 +82,14 @@ public function uploadAction(Document $document) public function downloadAction(File $file) { - $contentDisposition = 'attachment; filename="'.$file->getName().'"'; + $method = 'attachment'; if ($this->request->get('inline', false)) { - $contentDisposition = 'inline'; + $method = 'inline'; } $response = new Response(); $response->headers->set('Content-Type', "application/pdf"); - $response->headers->set('Content-Disposition', $contentDisposition); + $response->headers->set('Content-Disposition', $method.'; filename="'.$file->getName().'"'); $response->headers->set('Content-Transfer-Encoding', 'binary'); $response->headers->set('Content-Length', filesize($file->getPath())); $response->setStatusCode(200);