From: Vincent Vanwaelscappel Date: Fri, 11 Apr 2025 15:09:26 +0000 (+0200) Subject: wip #7423 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=57a81a5b4bc8c548f9ee0b822114f3ae5930566e;p=cubist_util.git wip #7423 @1 --- diff --git a/src/Files/Files.php b/src/Files/Files.php index 2cc7baa..4b74eb2 100644 --- a/src/Files/Files.php +++ b/src/Files/Files.php @@ -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