How to upload base64 image in php
You need to extract the base64 image data from that string, decode it and then you can save it to disk, you don't need GD since it already is a png.
And as a one-liner:
An efficient method for extracting, decoding, and checking for errors is:
In this tutorial, we will let you know how to handle the image encoded with Base64 and write the image to folder. Example Core PHP:
Upload base64 to file in CodeigniterAre you looking for a way to save a PNG image server-side, from a base64 data string, or unable to upload to a base64 encoded image using Codeigniter? We can help you with that. We are creating some function for using base64 string check is valid or not and size and file type create file application/libraries/Base64fileUploads.php
Example Codeigniter :Call this class Codeigniter in controller |