anacronw/multer-s3

AccessControlListNotSupported: The bucket does not allow ACLs

Closed this issue · 2 comments

When i pass acl:'public-read' i'm getting this error "AccessControlListNotSupported: The bucket does not allow ACLs"

Here is code i've used,

var uploadFileS3 = multer({
    storage: multerS3({
        s3: s3,
        bucket: S3_BUCKET,
        acl:'public-read',
        metadata: function (req, file, cb) {
            cb(null, Object.assign({}, req.body));
        },
        key: function (req, file, cb) {
            let fileKey = Date.now().toString() + '-' + file.originalname
            req.fileName = file.originalnamee
            cb(null, fileKey)
        }
    })
})

Is that bucket set as public on the AWS side?

Screen Shot 2022-05-13 at 3 09 56 PM
Try adjusting this setting.