I have a phonegap application and I want it to upload multiple files to a server which is an async operation. However, because of bandwidth concerns I want to upload the files sequentially and alert the user to the progress.
However, I'm a bit stuck. Since the api is non-blocking and I am (somewhat) attempting to block, I'm not sure exactly how to do this.
I need to do something like this:
files[0].upload().done = function() {
files[1].upload().done = function() {
files[2].upload().done = function() {
files[3].....files[n]
}
}
}
How can I do this? At this time, I don't care about failed uploads.