DEV Community

Victor Osas Ighalo
Victor Osas Ighalo

Posted on

Upload base64 encoded image with Laravel

I am going to be really straight to the point on this one. If you need to upload a base64 encoded image or you just want to learn how to do it for future use, then bookmark this page now.

I won't talk about the User Interface or the input form. I will only talk about the actual method within your controller. I will assume you have that part covered already and your are building a RESTful API. So let's call the method UploadImage

What does this method do? 🤓

The method uploads multiple image types, such as: jpeg, png, svg, gif and base64 encoded images. So it handles all our image upload needs 🏌🏼‍♂️


public function UploadImage(Request $request) { 
//method body goes here
 }

Enter fullscreen mode Exit fullscreen mode

continue

Top comments (0)