Getting error Cross-Origin Request Blocked in s3 bucket file uploading

Viewed 542

I am new in s3 bucket AWs, When i try to upload file in s3 bucket i am getting error : Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://xxxxxxx.com, can anyone please help me to resolve this issue ?

CORS Configuration

<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>DELETE</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
1 Answers

add the cross policy in your s3 bucket ( Cross-origin resource sharing (CORS) )

    [
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
    }
]
Related