I noticed that there is a question before asking how to \"Detect when browser receives file download\".
This requires the server to send a cookie in order to complete th
Edit: You can also ise an ajax call to get a base64 string of the zip and then clientside convert it to a blob in html5. But that requires to base64 encode the file server side and it increases the file size by around 33%.
I would make an ajax call that checks is the file is already generated after starting the download with a timer:
$.ajax({
type: 'HEAD',
url: 'generatedfileurl',
success: function() {
alert('File found.');
},
error: function() {
alert('File not found.');
}
});
Then when the file is found I'd wait a few seconds and then start download nr2 since I assume that file nr1 is already downloading since it has already been generated.
It's far from ideal, I'd definitely recommend using cookies or something else serverside.