]> _ Git - cubist_util.git/commitdiff
wip #7423 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Apr 2025 15:09:26 +0000 (17:09 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Apr 2025 15:09:26 +0000 (17:09 +0200)
src/Files/Files.php

index 2cc7baa55eba210688830ea58abaccbc70105181..4b74eb228114ed24136b9eb572a860fbbdd7bf43 100644 (file)
@@ -5,6 +5,7 @@ namespace Cubist\Util\Files;
 use Cubist\Util\CommandLine;
 use Cubist\Util\Text;
 use Illuminate\Http\UploadedFile;
+use Symfony\Component\HttpFoundation\File\File;
 
 class Files
 {
@@ -513,4 +514,9 @@ class Files
         }
         return $res;
     }
+
+    public static function asDataURI($path)
+    {
+        return 'data:' . self::getMimeType($path) . ';base64,' . base64_encode(file_get_contents($path));
+    }
 }
\ No newline at end of file