From a3a24b4b4b0f793c4cb211d52753a30aea7d335b Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 27 Nov 2023 12:25:45 +0100 Subject: [PATCH] fix(AttachmentController): Set fileName of returned attachments Signed-off-by: Jonas --- lib/Controller/AttachmentController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Controller/AttachmentController.php b/lib/Controller/AttachmentController.php index 42cdc6b01cf..373f60d93b8 100644 --- a/lib/Controller/AttachmentController.php +++ b/lib/Controller/AttachmentController.php @@ -207,7 +207,7 @@ public function getImageFile(string $imageFileName, ?string $shareToken = null, return $imageFile !== null ? new DataDownloadResponse( $imageFile->getContent(), - (string) Http::STATUS_OK, + $imageFile->getName(), $this->getSecureMimeType($imageFile->getMimeType()) ) : new DataResponse('', Http::STATUS_NOT_FOUND); @@ -241,7 +241,7 @@ public function getMediaFile(string $mediaFileName, ?string $shareToken = null): return $mediaFile !== null ? new DataDownloadResponse( $mediaFile->getContent(), - (string) Http::STATUS_OK, + $mediaFile->getName(), $this->getSecureMimeType($mediaFile->getMimeType()) ) : new DataResponse('', Http::STATUS_NOT_FOUND); @@ -275,7 +275,7 @@ public function getMediaFilePreview(string $mediaFileName, ?string $shareToken = if ($preview['type'] === 'file') { return new DataDownloadResponse( $preview['file']->getContent(), - (string) Http::STATUS_OK, + $mediaFileName, $this->getSecureMimeType($preview['file']->getMimeType()) ); } elseif ($preview['type'] === 'icon') {