how to invoke the file download window in javascript?
I have got a PDF fle which 开发者_如何转开发i would like my users to download when they click on a button/link/image.Is this possible?
Thank You
If you want to override any plugins for viewing a PDF in browser, then you need to send an HTTP Content-Disposition header to state that it should be treated as an attachment.
The specifics of how you achieve this depend on the server side environment you are using. JavaScript can't help you (unless you are using a server side JavaScript implemention, which is unlikely).
What's wrong with...
<a href="file.pdf">pdf</a>
I would simply configure IIS to server .pdf files as the MIME type application/octet-stream
精彩评论