Getting 403 (Forbidden) when uploading to S3 with a signed URL

后端 未结 6 1408
礼貌的吻别
礼貌的吻别 2021-02-07 03:30

I\'m trying to generate a pre-signed URL then upload a file to S3 through a browser. My server-side code looks like this, and it generates the URL:

let s3 = new          


        
6条回答
  •  無奈伤痛
    2021-02-07 03:44

    If you're trying to use an ACL, make sure that your Lambda IAM role has the s3:PutObjectAcl for the given Bucket and also that your bucket allows for the s3:PutObjectAcl for the uploading Principal (user/iam/account that's uploading).

    This is what fixed it for me after double checking all my headers and everything else.

    Inspired by this answer https://stackoverflow.com/a/53542531/2759427

提交回复
热议问题