Access Denied upload to s3

前端 未结 3 1781
渐次进展
渐次进展 2021-02-19 01:16

I tried uploading to s3 and when I see the logs from the s3 bucket logs this is what it says:

mybucket-me [17/Oct/2013:08:18:57 +0000] 120.28.112.39 
arn:aws:sts         


        
3条回答
  •  遇见更好的自我
    2021-02-19 01:54

    2019+

    You now either have to:

    • Set Block new public ACLs and uploading public objects to false if your items are public (top left policie in the picture)

    • Set acl: 'private' when uploading your image if your items are private

    Example in Node.js:

    const upload = multer({
        storage: multerS3({
            s3: s3,
            bucket: 'moodboard-img',
            acl: 'private',
            metadata: function (req, file, cb) {
                cb(null, {fieldName: file.fieldname});
            },
            key: function (req, file, cb) {
                cb(null, Date.now().toString())
            }
        })
    })
    

提交回复
热议问题