var dataURItoBlob = function (dataURI) { var byteString = atob(dataURI.split(',')[1]); var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } return new Blob([ab], { type: mimeString}); }, var fd = new FormData(), var fname = (new Date().getTime()) + parseInt(Math.random() * 1000, 10) + ".jpg", var blob = dataURItoBlob("data:image/jpg;base64," + that.imgEditerPlugin.encodeBase64()); fd.append("file", blob, fname); $.ajax({ contentType: false, cache: false, url: uploadUrl, type: "POST", processData: false, data: fd }).then(function(){ );