Step 4 – CORS Configuration (Optional)

If you intend to use Direct Upload functionality, you’ll need to set the CORS policy on your bucket.

Step 4.1 – Bucket Properties

Log into the Amazon S3 Console and select your bucket. Click on the Permissions tab and then select CORS Configuration

image.png

Step 4.2 – Set the CORS Configuration

Copy and paste the example CORS configration found below into the CORS configration editor in the S3 console.

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>HEAD</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>
image.png

Click Save.

Your CORS configuration has now been set and you should be able to perform direct uploads when you’ve enabled that feature.