开发者

How to prompt browser to display open/save dialog box using jquery?

开发者 https://www.devze.com 2022-12-26 20:45 出处:网络
How to prompt browser to dis开发者_运维百科play open/save dialog box using jquery?Not possible. The browsers handle that specifically so that hackers can\'t force you to download a virus, which would

How to prompt browser to dis开发者_运维百科play open/save dialog box using jquery?


Not possible. The browsers handle that specifically so that hackers can't force you to download a virus, which would be much easier for them if it happened in javascript.


What I've done in situations such as this is open an invisible iFrame on the page using javascript, which opens a page with the apprepriate HTTP headers:

Content-Disposition: attachment; filename=genome.jpeg;

naturally change "genome.jpg" to the appropriate default filename.

0

精彩评论

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

关注公众号