3D FlipBook - Flipbook Source PDF URL generated source code hangs

s***e@biomedx.com
2020-08-05
2020-08-05

Hi. I'm testing 3D Flipbook. When clicking on the 3D Flipbook icon in classic editor to generate the shortcode to get the PDF from another URL (in this case a site subdirectory), I get "Please wait... the Application is Loading" message.

I have viewed your video at https://www.youtube.com/watch?v=U2nFc4Ksjuo where the shortcode pulls from Amazon and you had to alter CORS configuration.

I discovered I need CORS enabled in my subdirectory and can add this to an .htaccess file and put it into the folder that has the PDF files, but I am clueless as to what this should say. I am on an Apache server. Generically, 3D Flipbook is at https://xyz.com and it needs to pull pdf files from https://sub.xyz.com/folder/. I need to allow access for 3D Flipbook to get the pdf files from the subdirectory, but do not want to enable CORS from any other URL. Could you provide the proper terminology?

I am not a programmer and only know some very basic things, like how to put something into an .htaccess file. I found the following online and put my own domain in place of .xyz and put it into an .htaccess file in the subdomain folder I have the pdf files but it did not work. Any help is greatly appreciated:

<IfModule mod_headers.c>
    SetEnvIf Origin "https://get\.xyz\.com$" AccessControlAllowOrigin=$0
    Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
    Header add Access-Control-Allow-Headers * env=AccessControlAllowOrigin
    Header merge Vary Origin
</IfModule>

When I pasted the above into this question it is missing the beginning - IfModule mod_headers.c - and the ending - /IfModule.

Replies

a***r@3dflipbook.net
2020-08-05
2020-08-05

Start from

# 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>

if it works, try to limit domain:

# CORS for PDFs
<IfModule mod_headers.c>
<Files ~ ".*\.pdf$">
Header add Access-Control-Allow-Origin "https://xyz.com"
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>

See the debugging console for any errors (for Chrome Ctrl+Shift+I).

s***e@biomedx.com
2020-08-05
2020-08-05

That's it! Thank you very much. I think this is one that should go in your documentation.

Log In to leave a comment