I am using the javascript to download multiple file from url.
I have used the following url to do this but not find any solutions,
Its working fine for firefox and google chrome but not work with ie and edge
I have used the following code.
reportFileList.forEach((report, index) => {
var downloadUrl = report
setTimeout(function() {
var a = document.createElement('a');
a.href = downloadUrl;
a.target = '_parent';
if ('download' in a) {
a.download = downloadUrl;
}
(document.body || document.documentElement).appendChild(a);
if (a.click) {
a.click(); // The click method is supported by most browsers.
}
a.parentNode.removeChild(a);
}, 500);
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…