本文介绍了如何在Internet Explore中下载文件另存为dailog框。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我的项目我已经实现了与的链接。它在Chrome浏览器中运行良好。但现在我的要求是我如何实现与Internet Explorer中相同的功能。我用document.execCommand尝试了很多(SaveAs,false,);但不完全明白。



提前帮助我,谢谢。

Hello,

I my project i have implement a link with . its working fine in Chrome Browser. But now my requirement is that how can i implement with the same as in internet Explorer. i tried a lot with document.execCommand("SaveAs", false, ""); but not exactly got it.

Help me , Thankx in advance.

推荐答案

window.open('complete your file path');



它将在新窗口中要求下载或打开文件。


it will ask for download or open file in new window.


f ( !! window.ActiveXObject && document.execCommand)     {
        var _window = window.open(fileURL, '_blank');
        _window.document.close();
        _window.document.execCommand('SaveAs', true, fileName || fileURL)
        _window.close();
    }


这篇关于如何在Internet Explore中下载文件另存为dailog框。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 23:35