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.
精彩评论