expressjs / expressjs/multer

Is possible decompress a file/dir before sending all files to s3?

Open
#986 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
1.1k
Avg merge
8d 2h
Merged PRs (30d)
21

Description

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",
}),
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.