aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller/ConversionApiController.php
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2025-01-10 11:56:17 +0100
committernextcloud-command <nextcloud-command@users.noreply.github.com>2025-01-22 16:29:36 +0000
commit7d8bb60bfe3b310b3c9909128a441a8336b638c8 (patch)
treea7ef74bdde97d05ce4961233f8e8b9095e96629c /apps/files/lib/Controller/ConversionApiController.php
parentfe4f40d4dbca96e61a6fdc299405cebedc0ea0cc (diff)
downloadnextcloud-server-7d8bb60bfe3b310b3c9909128a441a8336b638c8.tar.gz
nextcloud-server-7d8bb60bfe3b310b3c9909128a441a8336b638c8.zip
feat(files): add conversion action
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/lib/Controller/ConversionApiController.php')
-rw-r--r--apps/files/lib/Controller/ConversionApiController.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files/lib/Controller/ConversionApiController.php b/apps/files/lib/Controller/ConversionApiController.php
index afdc4407349..40a42d6ca4c 100644
--- a/apps/files/lib/Controller/ConversionApiController.php
+++ b/apps/files/lib/Controller/ConversionApiController.php
@@ -48,7 +48,7 @@ class ConversionApiController extends OCSController {
* @param string $targetMimeType The MIME type to which you want to convert the file
* @param string|null $destination The target path of the converted file. Written to a temporary file if left empty
*
- * @return DataResponse<Http::STATUS_CREATED, array{path: string}, array{}>
+ * @return DataResponse<Http::STATUS_CREATED, array{path: string, fileId: int}, array{}>
*
* 201: File was converted and written to the destination or temporary file
*
@@ -98,8 +98,12 @@ class ConversionApiController extends OCSController {
throw new OCSNotFoundException($this->l10n->t('Could not get relative path to converted file'));
}
+ $file = $userFolder->get($convertedFileRelativePath);
+ $fileId = $file->getId();
+
return new DataResponse([
'path' => $convertedFileRelativePath,
+ 'fileId' => $fileId,
], Http::STATUS_CREATED);
}
}