3D FlipBook - Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.9.200.110/xxx.pdf.

z***n@cecn.net
2019-08-08
2019-08-08

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.9.200.110/xxx.pdf. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

How to solve the issue, PDF is stored on different computer . I can access the PDF directly from the browser.

Replies

a***r@3dflipbook.net
2019-08-08
2019-08-08

Hi,

You need to give access for JavaScript. Put this into .htaccess of the PDF web server:


# CORS for PDFs
<IfModule mod_headers.c>
<Files ~ ".*.pdf$">
Header add Access-Control-Allow-Origin "*" 
Header add Access-Control-Allow-Methods "GET" 
Header add Access-Control-Allow-Headers: "Range" 
Header add Access-Control-Expose-Headers: "Accept-Ranges, Content-Encoding, Content-Length, Content-Range" 
</Files>
</IfModule>

Best regards,

Ivan.

Log In to leave a comment