开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜