# Getting issue in uploading image. Facing 'Access-Control-Allow-Origin' issue

**URL:** <https://discourse.processing.org/t/getting-issue-in-uploading-image-facing-access-control-allow-origin-issue/43832>\
**Category:** Development\
**Created:** [February 5, 2024, 9:21am UTC](https://discourse.processing.org/t/getting-issue-in-uploading-image-facing-access-control-allow-origin-issue/43832 "2024-02-05T09:21:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashwani](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@ashwani](https://discourse.processing.org/u/ashwani)\
**Post date:** [February 5, 2024, 9:21am UTC](https://discourse.processing.org/t/getting-issue-in-uploading-image-facing-access-control-allow-origin-issue/43832/1 "2024-02-05T09:21:41Z")

</div>

I am facing issues while uploading images in my sketch in local setup, and issue is with AWS setup.  
Pasting the screenshot of error:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/c/e/ce5566ae5f90d41cf98f97a3404f9942571d708a.png)

I have followed all the step given in [guide](https://gist.github.com/catarak/70c9301f0fd1ac2d6b58de03f61997e3)

These are my .env variable

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/4/9/49e280cea79a642c016c7e2b83bde073a9509e4a.png)

Please correct me if I am wrong:  
`S3_BUCKET` - is name of aws bucket  
`AWS_REGION` - is bucket region which we have to setup while creating bucket  
`AWS_SECRET_KEY` and `AWS_ACCESS_KEY` - In ‘Security credentials’ under my name in top right corner of AWS console → Created new access key and copied these two variable.

For bucket policy I used this:

```auto
{
    "Version": "2008-10-17",
    "Id": "Policy1397632521960",
    "Statement": [
        {
            "Sid": "Stmt1397633323327",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::ash97531/*"
        }
    ]
}

```

For cors I used this:

```auto
[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD",
            "PUT",
            "POST",
            "DELETE"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]

```

Can anyone tell me why I still facing this error while uploading any image?  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/6/e/6eef961f6120ad0927d76b1f0e0f90447561b12f.png)

I have even raised a discussion thread on github but I didn’t get any response: [here](https://github.com/processing/p5.js-web-editor/discussions/2984)
