From: Vincent Vanwaelscappel Date: Mon, 9 Sep 2024 15:49:49 +0000 (+0200) Subject: wait #7069 @0:40 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bac5e7e4f6c16b6eeda360ab915efa7218dfb4ac;p=fluidbook-toolbox.git wait #7069 @0:40 --- 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);