You can use FormData
to emulate the usual file "multipart/form-data"
submit:
canvas.toBlob( function(blob) { var formData = new FormData(); formData.append("image_file", blob ); var xhr = new XMLHttpRequest; xhr.open( "POST", "abc.php" ); xhr.send(formData); }, "image/png");
.toBlob
canvas .toBlob
specified but not implemented, you can use polyfill for example canvas-to-blob.js
source share