Downloading Multiple Files Into A Zip File Javascript Using Data Uri
I am using EXT JS 4.2 which has a panel which contains a export to CSV button. On clicking on it multiple (total six) files are downloaded. I want these files to be downloaded in a
Solution 1:
There is a perfect plugin to create zip files inside browser.
Install the plugin by adding js files manually:
download JSZip and include the file dist/jszip.js or dist/jszip.min.js
JSFiddle - JSZip 3.0:
var zip = newJSZip();
for (var i = 0; i < 5; i++) {
varCSV = 'CSV_content';
// Fill CSV variable
zip.file("file" + i + ".csv", CSV);
}
zip.generateAsync({
type: "base64"
}).then(function(content) {
window.location.href = "data:application/zip;base64," + content;
});
Post a Comment for "Downloading Multiple Files Into A Zip File Javascript Using Data Uri"