diff --git a/src/Controller/AttachmentsController.php b/src/Controller/AttachmentsController.php index 2839583..a3bfad3 100644 --- a/src/Controller/AttachmentsController.php +++ b/src/Controller/AttachmentsController.php @@ -273,7 +273,7 @@ public function file($id, $name = null) if (!file_exists($attachment->path)) { throw new \Exception("File {$attachment->path} cannot be read."); } - $file = new File($attachment->filetype); + $file = new File($attachment->path); $response = $this->response->withFile($attachment->path, ['download' => false, 'name' => $attachment->filename]) @@ -297,7 +297,7 @@ public function download($id, $name = null) if (!file_exists($attachment->path)) { throw new \Exception("File {$attachment->path} cannot be read."); } - $file = new File($attachment->filetype); + $file = new File($attachment->path); $response = $this->response->withFile($attachment->path, ['download' => true, 'name' => $attachment->filename])