From 57a81a5b4bc8c548f9ee0b822114f3ae5930566e Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 11 Apr 2025 17:09:26 +0200 Subject: [PATCH] wip #7423 @1 --- src/Files/Files.php | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.39.5