在应用中通过window.open(filename,'_self')下载excel时,变成直接在浏览器打开excel,而且还是乱码,在网上找了很多办法,如设置web.xml,在web.xml增加
也无效,最终找到一个办法,解决的这个问题,验证通过。解决的办法是:
通过以上代码,在ie中会弹出对话框,提示保存。
作者:[url=http://www.alibabataba.com]阿里巴巴taba[/url]
<mime-mapping>
<extension>xls</extension>
<mime-type>application/msexcel</mime-type>
</mime-mapping>
也无效,最终找到一个办法,解决的这个问题,验证通过。解决的办法是:
var w = window.open("","_self");
w.location.href=fileUrl;
通过以上代码,在ie中会弹出对话框,提示保存。
作者:[url=http://www.alibabataba.com]阿里巴巴taba[/url]