When I try to upload a JS file to S3, I get the upload error: OptionsRequestDenied. All the other files, including the JS ones have worked except this one.
The file makes some cross-origin requests using jQuery like this:
function corsRequest(callback){
$.get("www.example.com", function(data, status){
callback(data);
})
}
setInterval(corsRequest, 5000);
I've tried changing the CORS settings to allow all methods:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
However, OPTIONS
is not allowed and returns the error:
Found unsupported HTTP method in CORS config. Unsupported method is OPTIONS
I even created a fresh bucket and it won't upload there either.
I can't find a reference to the error in the AWS docs. Any help would be appreciated.
The "403 Access Denied" error can occur due to the following reasons: Your AWS Identity and Access Management (IAM) user or role doesn't have permissions for both s3:GetBucketPolicy and s3:PutBucketPolicy. The bucket policy denies your IAM identity permission for s3:GetBucketPolicy and s3:PutBucketPolicy.
This error message indicates that your IAM user or role needs permission for the kms:GenerateDataKey and kms:Decrypt actions. Follow these steps to add permissions for kms:GenerateDataKey and kms:Decrypt: 1. Open the IAM console.
Turning off any tracking blocker extension like uBlock Origin fixed it for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With