requirements: click on a folder and you need to download all the sub-files in the file.
that is, when you click on a folder, the backend returns an array of files id for traversal download.
I used the tag href function to download and append the download attribute so that the file will only be downloaded as a download.
however, this attribute is unique to html5 and only supports Chrome and Firefox. Ie does not support it.
in practice, both Chrome and Firefox can download all the files one by one, while ie downloads only one file, as shown in the following figure.
Picture description
related codes
/ / Please paste the code text below (do not replace the code with pictures)
downloadByA(url, options) {
var a = document.createElement("a");
a.style.display = "none";
a.download = "";
a.href = `${url}?sid=${options.sid}&fileParent=${options.fileParent}&fileId=${options.fileId}`
document.body.appendChild(a);
a.click();
a.remove();
}
I wonder if it is the cause of download? How to make ie download multiple files? What is a better way to download multiple files?
I hope any Daniel will pass by and take a look at it and give me some advice. thank you.