Welcome Guest, Not a member yet? Register   Sign In
serialize data:image/png;base64 data type json
#2

Shit happend to me, i forget to remove old documentasi what i have got from <a href="http://stackoverflow.com/questions/16196879/send-canvas-and-form-to-server-save-image-with-custom-name">Here</a>

<code>
$dataURL=$this->input->post('images_crop');
// $dataURL = $_POST["imageData"]; this should send to the hell cause spend long time
$dataURL = str_replace('data:image/png;base64,', '', $dataURL);
$dataURL = str_replace(' ', '+', $dataURL);
$image = base64_decode($dataURL);
$filename = date("d-m-Y-h-i-s") . '.' . 'png'; //renama file name based on time

$path = set_realpath('uploads/product/');
file_put_contents($path. $filename, $image);

</code>


Thanks any one will reblog it later on

/*-------------Solved-------------*/
Reply


Messages In This Thread
RE: serialize data:image/png;base64 data type json - by freddy - 12-09-2015, 10:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB