开发者

How can I prevent the Internet Explorer Info Bar from appearing when a user downloads a file?

开发者 https://www.devze.com 2023-03-30 11:26 出处:网络
Currently to have to user download a file I have the following javascript. document.location.href = \'Filesave.ashx?filename=file.zip\';

Currently to have to user download a file I have the following javascript.

document.location.href = 'Filesave.ashx?filename=file.zip';

However this results in the 'To help product your security..' info bar开发者_如何学编程 to show up in IE and once the user refreshes the page they are unable to go to their download.

I saw somewhere that you can set the source of a hidden iframe to the file and this would not cause the security issue in IE. I have tried this but am unable to get it working, the info bar still appears.

Any suggestions?


This is not a scriptable object (thankfully). If it were, everyone serving up malware would get rid of it too.

0

精彩评论

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

关注公众号