serialize data:image/png;base64 data type json |
Hello guys, need some guide honestly already post in stackoverflow but nothing respond there so i repost in here, what i have been developing is
Here is demo (please see and tested first) in view file the reason why i make input type="text" to aplicated new revision to old projects Here is my js Code: $('#btnsubmit').on("click", function(e) { and this is my controller Code: $dataURL=$this->input->post('images_crop'); all i have got so far blank image in folder with size 0kb, Thanks for some one reading, vote up, vote down, comments ![]()
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-------------*/ |
Welcome Guest, Not a member yet? Register Sign In |