Thanks Steve, I have been tinkering with this on my end. The code below does upload images but not in sequence I am just putting it here maybe you can notice something I am doing wrong.
I will work with your code and see what results I get.
code
//This is the function inside the button submit.
function uploadImage_Data() {
var deferred = $.Deferred();
//First upload all images by calling the image upload functions
$.when(UploadImage1(),UploadImage2(),UploadImage3()).promise().done
console.log("uploading images Done. Upload Data");
//when done uploading images, upload raw data.
APIExpress_submit_Report.execute();
}
//I have a total of 5 functions, for now I am just showing 2 but they all look similar
function UploadImage1() {
var deferred = $.Deferred();
console.log("uploading image #1");
uploadBinaryHelper(image01_UploadService, Apperyio.storage.Image1_base64.get()); //this is service upload for image 1
deferred.resolve();
return deferred.promise;
}
function UploadImage2() {
var deferred = $.Deferred();
console.log("uploading image #2");
uploadBinaryHelper(image02_UploadService, Apperyio.storage.Image2_base64.get()); //this is service upload for image 2
deferred.resolve();
//return deferred.promise;
return deferredObject.promise;
}
/code