Possible Duplicate:
jquery: how to force a pdf download automatically?
Afternoon folks,
I have a pdf file which the user can download. I want this to be done from Javascript rather than an <a> or similar.
So I have this code, but it opens in a new window/tab.
window.open(url,'Download');
How can I tell the browser to show a download dialog box, instead of displaying the PDF inline?
Your server has to serve up the document with a “Content-disposition” header:
You can’t make that happen from JavaScript.