Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

amazon s3 CORS problem

New Here ,
Apr 06, 2021 Apr 06, 2021

Dear 

 

I use that code to embed PDF on my website and I host the files on AWS s3 file storage

 

<div id="adobe-dc-view" style="height: 800px;padding-bottom: 50px"></div>
<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function()
{
var adobeDCView = new AdobeDC.View({clientId: "XXXXX", divId: "adobe-dc-view"});
adobeDCView.previewFile(
{
content: {location: {url: "https://s3-eu-west-1.amazonaws.com/file.pdf"}},
metaData: {fileName: "title"}
});
});
</script>


 and  I have CORS problem, How I can solve it?

 

Access to XMLHttpRequest at 'https://s3-eu-west-1.amazonaws.com/' from origin  www.example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

 

Thanks

1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 06, 2021 Apr 06, 2021

You'll need to configure the S3 bucket to allow your domain. This link might help. 

Translate
Community Expert ,
Apr 06, 2021 Apr 06, 2021
LATEST

You'll need to configure the S3 bucket to allow your domain. This link might help. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources