Upload base64 image to S3 in Laravel 5.5
1 min readDec 20, 2017
list($baseType, $image) = explode(';', $base64);
list(, $image) = explode(',', $image);
$image = base64_decode($image);$imageName = rand(111111111, 999999999) . '.png';
$p = Storage::disk('s3')->put('filepath/' . $imageName, $image, 'public');
The key point is that you need to give filename specifically.
The adapter can’t get the real path of base64 data. I guess it’s because base64 data is not a file object.