The generateAsync method does not work on Node.js 6.2.2. Then promise that is returned is never called.
A demonstration: https://www.youtube.com/watch?v=HMXykAhBfuM&feature=youtu.be .
Test code:
var JSZip = require('jszip');
try {
var zip = new JSZip();
zip.file("Hello.txt", "Hello World\n");
console.log('Start generateAsync');
zip.generateAsync({type: "blob"})
.then(function (content) {
console.log('Stop generateAsync');
console.log(content);
});
} catch (ex) {
console.log(ex);
}
There was no error given by jszip. Apparently blob is not supported on my platform. I solved this issue by using the type nodebuffer.
This issue can be closed
from where i should find the type nodebuffer. thanks and regards
Hello, I am using node 6.11.1 and trying to zip an array of links, but it so happens that sometimes it zips the complete ones but sometimes, it does not do for all the links.
Any help or redirect to links would be helpful. Thanks
I am using jszip in salesforce.com and i am getting same error and here is the code
saveData : function(data, fileName, helper) {
var attachments = data.attachments;
var zip = new JSZip();
var csv = helper.convertArrayOfObjectsToCSV(data.contentDocumentLinks);
alert(data.contentDocumentLinks);
zip.file("Attachments.csv", csv);
var attachmentsFolder = zip.folder("Attachments");
for(var i=0;i
}
zip.generateAsync({type:"blob"}).then(function(content) {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
var url = window.URL.createObjectURL(content);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
$A.get("e.force:closeQuickAction").fire()
});
},
can you please help me with this
Most helpful comment
There was no error given by jszip. Apparently blob is not supported on my platform. I solved this issue by using the type nodebuffer.