I have a variable, which holds an image as a base64 string. How is it possible to put that file to a storage? I tried this:
\Illuminate\Support\Facades\Storage::disk($disk_name)->putFileAs($dir_path, base64_decode($image_str), $file_name);
Unfortunately I get this error: Call to a member function getRealPath() on string
The reason is, that the second parameter of the putFile function should be an Illuminate\Http\File object, but I have no idea how to create one from a base64 string.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2P4U0rw
via IFTTT
Aucun commentaire:
Enregistrer un commentaire