Open sravanisomepalli6 opened 7 years ago
Once you have your list of objects {filename, content}
, you need to add them to a zip instance:
either
let zip = new JSZip();
parts.forEach((p) => zip.file(p.filename, p.content));
or
let zip = parts.reduce((zip, p) => zip.file(p.filename, p.content), new JSZip());
Then, call generateAsync
to generate a promise of the result:
zip.generateAsync({type:"nodebuffer"}).then(/* success callback */).catch(/* error callback */)
try { let Email = new Emailer(); let str = await Email.send({ to , cc , bcc , from , subject: out_file_pattern_to_name(subject, {Name: name}) , html , attachments: attachements =======>[need to send here] }); console.log(str) return str; } catch(err) { throw err; }
Hi i am new to this i have a requirement to compress .xlsx files into .zip and sending this to mail. .xlsx file sending to email is done but i don't know how to compress this as .zip file. thanks plz help.... pls lookinto this;;;;