anacronw/multer-s3

Upload zip files as folders containing it's content

manishprivet opened this issue · 1 comments

As of my current requirement, I need to upload files as single objects but in case of zip files, it's content extracted to a folder same as the name of the zip.

My current code includes:

const upload = multer({
    storage : multers3({
        s3:s3,
        bucket:'bucket-name',
        metadata: (req,file,cb)=>{
            cb(null,Object.assign({},req.body));
        },
        key:(req,file,cb)=>{
            cb(null, `${file.originalname}`);
        }
        
    })
})

And in the express request handler

router.post('/image-upload',upload.array('upl', 1),(req, res) => {
  return res.send('Uploaded');
});

Unfortunately this is something that you'll have to build outside of this library...