// Check if domain need to be downloaded twice
if (fileName.includes("new.risparmioadesso.eu")) {
firstID = "1301015080";
secondID = "1301303370";
// Create a new Blob object with the modified CSV data
const firstBlob = new Blob([modifiedCsv], {type: 'text/csv'});
const secondBlob = new Blob([modifiedCsv], {type: 'text/csv'});
// Download the first Blob object as a CSV file
const firstUrl = window.URL.createObjectURL(firstBlob);
const firstAnchor = document.createElement('a');
firstAnchor.href = firstUrl;
firstAnchor.download = firstID + '_Risparmioadesso.csv';
firstAnchor.click();
// Download the second Blob object as a CSV file with a different name
const secondUrl = window.URL.createObjectURL(secondBlob);
const secondAnchor = document.createElement('a');
secondAnchor.href = secondUrl;
secondAnchor.download = secondID + '_newrisparmioadesso.csv';
secondAnchor.click();
}
I have this code inside my JS Query to be able to download multiple files, but it is not working.
I have manage this option but when I click done it will keep blocking downloads of multiple files. How to solve it?