multer
multer copied to clipboard
Is possible decompress a file/dir before sending all files to s3?
I need to unzip a directory, inside I have some files of some different extensions. How do I do this using this library?
s3: multerS3({
s3: new aws.S3(),
bucket: process.env.BUCKET_NAME,
shouldTransform: function (req, file, cb) {
() => {}
},
transforms: [
{
id: "original",
key: (request, files, callback) => {
console.log("F", files);
crypto.randomBytes(16, (error, hash) => {
if (error) callback(error);
const fileName = `${hash.toString("hex")}-${
files.originalname
}`;
callback(null, fileName);
});
},
transform: (request, files, callback) => {
console.log("F1", files);
},
},
],
contentType: multerS3.AUTO_CONTENT_TYPE,
acl: "public-read",
}),