For a webbased application we want to be able to let people sign on an Ipad.running IOS We use a canvas element to draw on and then upload it to an IBM I Service.running net.data It works fine on chrome and firefox on a pc.
on an ipad in safari or chrome though the request seems to be empty. I am searching for hours and don’t seem to be able to find out what is wrong with this code.
Does anybody Know Who I Could Fix this? We are not using jquery by the way. belowe is part of the code we use
thanks! j.v.
GUI.Signature.dataURItoBlob = function(dataURI) {
var binary = atob(dataURI.split(',')[1]);;
var array = [];
var content = null;
for(var i = 0; i < binary.length; i++) {
array.push(binary.charCodeAt(i));
}
content= new Uint8Array(array);
return new Blob([content], {type: 'image/jpeg'});
};
GUI.Signature.send = function(){
if(!GUI.Signature.isEnabled()){return;}
var request = new XMLHttpRequest();
var dataURL = GUI.Signature.canvas.toDataURL('image/jpeg', 0.8);
var blob = GUI.Signature.dataURItoBlob(dataURL);
var fd = new FormData(GLOBAL.activeForm);
var fsUri = GLOBAL.activeForm.action.replace("MAIN","UPLOAD");
fd.append("signature", blob);
fd.append("blobName","signature" );
request.open('POST', fsUri, false);
request.send(fd);
};