Skip to content

Commit

Permalink
fix(AttachmentController): Set fileName of returned attachments
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Nov 27, 2023
1 parent 2f665d6 commit a3a24b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Controller/AttachmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit a3a24b4

Please sign in to comment.