Good morning!
I have a java servlet which receives a list of parameters and generates a PDF file for me.
Something like:
http://url/download/file?id=123&ext=pdf
When I access that URL within my browser window, the file is downloaded.
The problem is that I need to download the file in a hidden iframe, and notify the user when the download completes.
Downloading the file is easy:
var iframe = $('<iframe/>', {
src: formURL+'&'+formData+'&docList='+inputDocList.val()
});
$('body').append(iframe);
Iframe is appended to the body and the download starts. I need to know when the download ends. I already tried using jquery's load event:
iframe.load(...)
but it wont trigger when my download finishes. I also tried inspecting the DOM of the iframe before and after the download completes, and it appears to be the same.
Is there a way to do this? I need a callback!
Thank you guys.