I have a group of attachments which are to be zipped by js and the zip file should be sent to the user as an attachment.
I am trying to zip the file using archiver.
If I add this zip files to the array of attachments in node mailer the file is corrupted since path is required for node mailer.
Any other way to dynamically create zip files without saving a copy on local or on server which can be reused to send to the client
var zip = Archiver('zip');
zip.append(file_to_be_zipped, { name: 'file2.txt' })
.finalize();
from: configuration.data.from,
to: req.body.to.join(';'),
cc: req.body.cc && req.body.cc.join(';'),
bcc: req.body.bcc && req.body.bcc.join(';'),
subject: subject,
html: body,
attachments: zip