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

后端 未结 6 1334
礼貌的吻别
礼貌的吻别 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:37

    Your request needs to match the signature, exactly. One apparent problem is that you are not actually including the canned ACL in the request, even though you included it in the signature. Change to this:

    var options = { headers: { 'Content-Type': fileType, 'x-amz-acl': 'public-read' } };
    

提交回复
热议问题