开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜