文件地址下载多个文件

99 阅读1分钟

后台返回文件地址

window.location.href 只能下载单个文件,多个文件会被覆盖

function downFiles(){
    let count=0;
    let hiddenIFrameID = 'hiddenDownloader' + count++;
    let iframe = document.createElement('iframe');
    iframe.id = hiddenIFrameID;
    iframe.style.display = 'none';
    document.body.appendChild(iframe);
    iframe.src = url;
}