Hi Yurii,
I tried your code on success:
it didnt work.
I added, console.log("fileurl success test");
this didnt show in the console.
so i tried adding the code to success in the js on button click:
pre
var fileName = "myFile.png";
var FDU = fileDataUrl64;
var FDUreplaced = FDU.replace('data:image/jpeg;base64,','');
var base64Content = FDUreplaced;
var fileBlob = b64toBlob(base64Content, "image/png");
var data = new FormData();
data.append(fileName, fileBlob);
var onSuccess = function(data){
Code: Select all
for(var i = 0; i < data.length; i++){
localStorage.setItem("TestfileURL", data[i].fileurl);
}
alert(JSON.stringify(data));
};
//Where "uploadService2" is your updload service datasource name.
uploadService2.execute({
'allowDataModification': false,
'processData': false,
'body': {data: data},
'cache': false,
'success': onSuccess
});
/pre
after button click, "TestfileUrl" local storage is "undefined".