From c3ddd4087fff8d3edd4bfe959283dc81a99c3f9a Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Tue, 22 Nov 2022 06:27:10 -0800 Subject: [PATCH] livephoto: add video download button --- lib/Controller/VideoController.php | 6 +++++- src/components/Viewer.vue | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/Controller/VideoController.php b/lib/Controller/VideoController.php index 21af9276..4d27800f 100644 --- a/lib/Controller/VideoController.php +++ b/lib/Controller/VideoController.php @@ -178,9 +178,13 @@ class VideoController extends ApiBase if ($liveFile instanceof File) { // Create and send response + $name = $liveFile->getName(); $blob = $liveFile->getContent(); - $response = new DataDisplayResponse($blob, Http::STATUS_OK, [ + + $response = new DataDisplayResponse($blob, Http::STATUS_OK, []); + $response->setHeaders([ 'Content-Type' => $liveFile->getMimeType(), + 'Content-Disposition' => "attachment; filename=\"$name\"", ]); $response->cacheFor(3600 * 24, false, false); diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index 9e22517e..084eec63 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -86,6 +86,17 @@ + + {{ t("memories", "Download Video") }} + +