admin管理员组文章数量:1425653
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
1 Answer
Reset to default 1I'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!
本文标签:
版权声明:本文标题:Internet Explorer - DOM7011: The code on this page disabled back and forward caching. Warning after trying to download Binary Fi 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745458054a2659194.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论