Skip to main content
Participant
July 8, 2022
Question

File preview error - Got it working for one and not the other .. Need Help.

  • July 8, 2022
  • 1 reply
  • 341 views

Hello,

I have a strange file preview error I do not understand. 

  1. https://marketing.marketingguys.nl/acton/media/7349/acton-hosted-pdf
    PDF file can be viewed with PDF Embed API. PDF file hosted on same server as webpage
  2. https://marketing.marketingguys.nl/acton/media/7349/external-hosted-pdf
    PDF file can be viewed with PDF Embed API. PDF url from Adobe demo
  3. https://marketing.marketingguys.nl/acton/media/7349/external-not-working
    PDF file gives file preview error with PDF Embed API. PDF file hosted on our company website server (marketingguys.com)
  4. https://marketingguys.com/nl/knowledge/whitepaper-sales-en-marketing-alignment-whitepaper/
    Same PDF file as number 3,  but webpages hosted on marketingguys.com, it works.

 

Why does the 2nd one work and the 3rd one not?

This topic has been closed for replies.

1 reply

Kyle Julé24692827
Adobe Employee
Adobe Employee
July 12, 2022

Hi there,

I think this has to do with CORS. When I open your "external-not-working" link, in the browser console I see this error:

Access to XMLHttpRequest at 'https://marketingguys.com/wp-content/uploads/2022/07/whitepaper-marketing-sales-alignment.pdf' from origin 'https://marketing.marketingguys.nl' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

There are browser add-ons that can help you get around such CORS errors.

Participant
July 14, 2022

Hi Kyle,

Thanks for the reply. I see the CORS error. But why does it appear on https://marketing.marketingguys.nl/acton/media/7349/external-not-working

and not on below page?

https://marketing.marketingguys.nl/acton/media/7349/external-hosted-pdf
Both directing to PDF file which is hosted somewhere else.

Very strange.

Kyle Julé24692827
Adobe Employee
Adobe Employee
July 14, 2022

The difference is likely that the one is hosted on Adobe domain, whereas the other is your personal webserver. You may be able to configure your server to allow this type of cross-domain request.