Currently, I use the jquery filedownload plugin to download multiple PDF, the A list page, which every single hyperlink CA N Download one pdf file.
When I click 1st link, every thing occured OK, if click 2nd or other link, Success msg alert before actual PDF downl Oad completed. It confused me a few days ...
Finally, I find the reason and got a to resolve the problem.
We can check source code in Jquery.filedownload.js, when Document.cookie contains value ' filedownload=true ', It'll pops u P Success Msg. The key is when finish the 1st download, the cookie does not expired!!! So when you click Second, third link,msg alert before download.
I tried set cookie ' s maxAge, but it still same error:
The thing we do is every download we need create a unique cookie.
Thanks http://gruffcode.com/2010/10/28/detecting-the-file-download-dialog-in-the-browser/,
We can generating a token value using the current timestamp as the value of ' filedownload ', this token can really is any a Rbitrary string value, but we did want to try and make it unique per request coming from the same browser, and using the The TI Mestamp is a pretty easy-to-do. We take this token and add it to the form within this hidden field that we created. This would ensure the token value gets submitted up to the server (more on this later).
Jquery.filedownload plugin:success msg alert before actual PDF download completed