I want to send the canvas data to the server side as image. I have been making an HTTP post request, but i am not able to get the data at server side. $_POST is empty but when i console the same object at JS side i get the image data.
this is the JS side
var XHR = new XMLHttpRequest(); var vvFD="image=" + JSON.stringify(document.getElementById('canvas').toDataURL("image/png")); console.log(vvFD); XHR.upload.addEventListener('progress', uploadProgress, false); XHR.addEventListener('load', uploadFinish, false); XHR.addEventListener('error', uploadError, false); XHR.addEventListener('abort', uploadAbort, false); XHR.open('POST', 'example_upload/upload1.php'); XHR.send(vvFD); and the PHP side is...
if(!empty($_POST)) { //do stuff } else { echo "_POST is empty"; } I am getting the message _POST is empty.
Any one can here help
Thanks in advance