]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7069 @0:40
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Sep 2024 15:49:49 +0000 (17:49 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Sep 2024 15:49:49 +0000 (17:49 +0200)
app/Models/FluidbookDocument.php

index a5e1e795cb3d03047696a8a3ad0acdc56d51e7f3..6b4109815a43f3236d599a8505819eb9a3ca8383 100644 (file)
@@ -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);