I download the file with usage of the 1st code here.
How can I wait (i.e. run request as synchronous) or know when download is finished?
Upd. Ok, looks like I should do something like:
myfunction = function(url) {
// downloading file here
persist.progressListener = {
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
if (aStatus == STATE_STOP) {
}
}
}
// once download is finished, myfunction should return result
}
How myfunction can return result, if I use listener?
Ok, here is the solution.