From bac5e7e4f6c16b6eeda360ab915efa7218dfb4ac Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 9 Sep 2024 17:49:49 +0200 Subject: [PATCH] wait #7069 @0:40 --- app/Models/FluidbookDocument.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/FluidbookDocument.php b/app/Models/FluidbookDocument.php index a5e1e795c..6b4109815 100644 --- a/app/Models/FluidbookDocument.php +++ b/app/Models/FluidbookDocument.php @@ -622,7 +622,9 @@ class FluidbookDocument extends ToolboxModel $document->owner = $owner->id; $document->save(); - rename($file->getPathname(), Files::mkdir($document->path()) . 'original.pdf'); + $moveFunction=($file instanceof UploadedFile)?'move_uploaded_file':'rename'; + + $moveFunction($file->getPathname(), Files::mkdir($document->path()) . 'original.pdf'); FluidbookDocumentUpload::updateProgression($uploadID, $document->id, __('Mise en file d\'attente du traitement du document'), 1.2); $dispatch = $async ? 'dispatch' : 'dispatchSync'; FluidbookDocumentUpload::$dispatch($uploadID, $document, backpack_user(), $fluidbook->id); -- 2.39.5