odysseyscience / react-s3-uploader

React component that renders an <input type="file"/> and automatically uploads to an S3 bucket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Obtaining signed URL and S3 OPTIONS succeed, S3 PUT fails with 403 Forbidden

PatSmuk360 opened this issue · comments

I've embedded the uploader in a web application. It works when testing locally but when we deploy to EC2 uploading no longer works. The uploader is able to obtain a signed S3 URL and send an OPTIONS request to it, but the subsequent PUT fails.

These are the requests.

The only difference I can notice between the local and EC2 signed URLs is that the EC2 URL has a x-amz-security-token parameter. Could the OPTIONS request be consuming the security token?

Apparently it just needs s3::PutObjectAcl permissions to work (as described here). Problem solved.

@PatSmuk360 I am also getting this error, even with those permissions. Are there any additional settings that you have on your bucket policy?

Also, any chance you're using NextJS/now? This was working fine for me until I moved to now v2