最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Internet Explorer - DOM7011: The code on this page disabled back and forward caching. Warning after trying to download Binary Fi

programmeradmin1浏览0评论

So, I'm trying to download binary files with javascript. It works fine on Chrome and Opera but doesn't work on IE.

After trying to download the files the warning "DOM7011: The code on this page disabled back and forward caching." appears on IE Developer Tools.

Does anyone already had this problem?

$.DownloadBase64File = function (file, data) {
    if (file && data) {
        var link = document.createElement('a');
        link.setAttribute('href', "data:application/octet-stream;charset=utf-16le;base64," + encodeURIComponent(data));
        link.setAttribute('download', file);
        link.click();
    };
};

if (data.status === '0') {
    $.DownloadBase64File(
        'MyPDF_File.pdf',
        data.ReportBinary
    );
}

Appretiate your help :)

So, I'm trying to download binary files with javascript. It works fine on Chrome and Opera but doesn't work on IE.

After trying to download the files the warning "DOM7011: The code on this page disabled back and forward caching." appears on IE Developer Tools.

Does anyone already had this problem?

$.DownloadBase64File = function (file, data) {
    if (file && data) {
        var link = document.createElement('a');
        link.setAttribute('href', "data:application/octet-stream;charset=utf-16le;base64," + encodeURIComponent(data));
        link.setAttribute('download', file);
        link.click();
    };
};

if (data.status === '0') {
    $.DownloadBase64File(
        'MyPDF_File.pdf',
        data.ReportBinary
    );
}

Appretiate your help :)

Share Improve this question edited Mar 5, 2018 at 16:29 Ricardo Cerdeira asked Mar 5, 2018 at 15:59 Ricardo CerdeiraRicardo Cerdeira 491 gold badge1 silver badge6 bronze badges 1
  • 1 @epascarello if only you knew the answer to my question... – Ricardo Cerdeira Commented Mar 6, 2018 at 15:10
Add a ment  | 

1 Answer 1

Reset to default 1

I've managed to solve my own problem and now I'll post the solution here to help others with the same problem.

I couldn't download files on IE. On other browsers like Chrome, Firefox and Opera was working fine. I searched a lot and even posted my problem here on StackOverflow although no one could help me find the answer.

I found this script that helped me.

The code is from dandavis and can be found here:
http://danml./download.html
https://github./rndme/download

Hope you can find it useful!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论