Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel upload base64 image

$image = $request->image;  // your base64 encoded
        $image = str_replace('data:image/png;base64,', '', $image);
        $image = str_replace(' ', '+', $image);
        $imageName = str_random(10).'.'.'png';
        File::put(storage_path(). '/' . $imageName, base64_decode($image));
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #laravel #upload #image
ADD COMMENT
Topic
Name
7+4 =