]> _ Git - cubist_util.git/commitdiff
wip #7063 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 Sep 2024 17:02:16 +0000 (19:02 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 Sep 2024 17:02:16 +0000 (19:02 +0200)
src/Files/Files.php

index 619d7ff600241bcacdd1471109a7708eea2ff8f8..982ecba232cdf6b05f51fb1a26fdf28f29cb3f98 100644 (file)
@@ -4,6 +4,7 @@ namespace Cubist\Util\Files;
 
 use Cubist\Util\CommandLine;
 use Cubist\Util\Text;
+use Illuminate\Http\UploadedFile;
 
 class Files
 {
@@ -483,4 +484,12 @@ class Files
         }
         return false;
     }
+
+    public static function move_uploaded_file(UploadedFile $file): string
+    {
+        $dir = Files::tmpdir();
+        $dest = $dir . '/' . $file->getClientOriginalName();
+        move_uploaded_file($file->getPathname(), $dest);
+        return $dest;
+    }
 }
\ No newline at end of file