Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!!! Preview for uploaded files is not working #2297

Closed
samholics opened this issue May 4, 2022 · 5 comments
Closed

!!! Preview for uploaded files is not working #2297

samholics opened this issue May 4, 2022 · 5 comments
Assignees

Comments

@samholics
Copy link

After uploading files in the Consultation page or Patient files, the preview for the same is not showing.

@samholics samholics added the good first issue Good for newcomers label May 4, 2022
@aeswibon aeswibon self-assigned this May 11, 2022
@aeswibon
Copy link
Member

aeswibon commented May 13, 2022

Getting errors whenever a put request is generated to AWS. The error generated is:

XHR OPTIONS https://egov-s3-patient-data-10bedicu.s3.amazonaws.com/CONSULTATION/d3c44c74-d47c-49d2-a119-abe549d3ef931652342184.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAULRENCOF6S7P2YT3/20220512/ap-south-1/s3/aws4_request&X-Amz-Date=20220512T075624Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a0dd9cb5460fa8b54d8f2ee3298a6d6a0c31ce34aeaa26de3fd892852261408f
CORS Missing Allow Origin

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://egov-s3-patient-data-10bedicu.s3.amazonaws.com/CONSULTATION/d3c44c74-d47c-49d2-a119-abe549d3ef931652342184.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAULRENCOF6S7P2YT3%2F20220512%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20220512T075624Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a0dd9cb5460fa8b54d8f2ee3298a6d6a0c31ce34aeaa26de3fd892852261408f. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 403.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://egov-s3-patient-data-10bedicu.s3.amazonaws.com/CONSULTATION/d3c44c74-d47c-49d2-a119-abe549d3ef931652342184.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAULRENCOF6S7P2YT3%2F20220512%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20220512T075624Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a0dd9cb5460fa8b54d8f2ee3298a6d6a0c31ce34aeaa26de3fd892852261408f. (Reason: CORS request did not succeed). Status code: (null).

Probably we need to change some of the settings in AWS.
This issue has been mentioned many times: #1897, #2196, #2296(Due to this issue)

@aeswibon
Copy link
Member

aeswibon commented Jun 6, 2022


@tomahawk-pilot @gigincg

@dauntlessnomad
Copy link
Member

[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT",
"POST"
],
"AllowedOrigins": [
"10bedicu.org",
"care.coronasafe.in",
"careapi.coronasafe.in"
],
"ExposeHeaders": [
"ETag"
],
"MaxAgeSeconds": 3000
}
]

@aeswibon
Copy link
Member

aeswibon commented Jun 10, 2022

@tomahawk-pilot It's still not working.The request is showing 403 Forbidden error

Request URL: https://egov-s3-patient-data-10bedicu.s3.amazonaws.com/CONSULTATION/52854bee-5282-42d2-bb81-f5f97a1e337c1654892265.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAULRENCOF6S7P2YT3%2F20220610%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20220610T201745Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=3e344408e7419b5e606784b3499f65dfa5d5276dca957a99ca4e91be6e73e472
Request Method: OPTIONS
Status Code: 403 Forbidden
Remote Address: xx.xxx.xxx.xxx:xxx
Referrer Policy: strict-origin-when-cross-origin

@mathew-alex
Copy link
Contributor

The file upload is working now. I am closing the Issue. Comment and reopen the issue if it happens again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants