Skip to main content
Participant
April 6, 2021
Answered

amazon s3 CORS problem

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

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Joel Geraci
    Joel GeraciCorrect answer
    Community Expert
    April 6, 2021

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

    1 reply

    Joel Geraci
    Community Expert
    Joel GeraciCommunity ExpertCorrect answer
    Community Expert
    April 6, 2021

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

    Translate