You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

ikenderham's avatar
ikenderham
Explorer | Level 3
5 years ago

Dropbox embedder not working - Blocked for X-frame-options

Hello

 

I am trying to show a dropbox folder on my wordpress website through your embedder.

 

I followed your guide on https://www.dropbox.com/developers/embedder but its not showing the folder. I just got a message that blocked  by poltics of x-frame-options

 

How can i solve it? I tried to Google it, but no one seems to have this issue.  I do not have any non-english charecters in the filename.

 

Link to the page where the issue is:

https://dropbox.diddo.dk/dropbox/

 

 

what i did do:

1. inserted the script

<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="myappkey here"></script>

 Inserted the anchor tag with link to my dropbox folder

 

But still its not working. Please help me solve it!

  • Greg-DB's avatar
    Greg-DB
    5 years ago

    Since you're attempting to use the Embedder on https://dropbox.diddo.dk/dropbox, you should register the domain 'dropbox.diddo.dk' (or just 'diddo.dk'; see my earlier comment).

     

    Do not include the protocol 'https://' since that's not part of the domain. Also, do not prepend 'www' since that's not in the actual domain in https://dropbox.diddo.dk/dropbox that you're using.

     

    I'm not sure why you're trying to use 'www' since that isn't part of the domain you've mentioned. But, if you did want to use the Embedder on https://www.diddo.dk/dropbox/, for instance, only then would you need to register 'www.diddo.dk' (or, as above, 'diddo.dk').

     

    Also, in your comment here I see you're showing a sample shared link from the Embedder docs, but on your actual page you are trying to use a different shared link (presumably your own). That shared link is currently returning a 404 error page though, indicating that the link has been disabled. So, once you register the correct domain above, you'll also want to replace this old disabled shared link with a working one.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    This can occur when attempting to use the Embedder on a domain that you haven't pre-registered for your app. (Apologies this isn't better communicated by the Embedder. I'll ask the team to see if we can improve that.)

    To fix this, you'll need to add your app's domain(s) to the "Chooser / Saver / Embedder domains" field on the app's info page on the App Console

     

    In this case, since your app is at https://dropbox.diddo.dk/dropbox/, you can register dropbox.diddo.dk or diddo.dk. (If you just need it to work on dropbox.diddo.dk, you should register that. If you need it to work on any *.diddo.dk, you should register diddo.dk.)

  • ikenderham's avatar
    ikenderham
    Explorer | Level 3
    Hello tanks for your reply. I did register the domain but it didnt work..
    • Greg-DB's avatar
      Greg-DB
      Icon for Dropbox Staff rankDropbox Staff

      Can you elaborate on what you mean when you say it didn't work? Specifically:

      • ikenderham's avatar
        ikenderham
        Explorer | Level 3

        I did register the URL www.diddo.dk and www.dropbox.diddo.dk

        i Tried to add the domain as https://dropbox.diddo.dk/ but its tell me the domain is invalid. And i also tried https://www.diddo.dk/ and the domain here is invalid too. But with www.diddo.dk i didnt have problems.

         

        Same error. Try to check https://dropbox.diddo.dk/dropbox

         

        here is what i did.

         

        1. Created a app

        2. Followed step on https://www.dropbox.com/developers/embedder

        The first thing i did is copyed the script

        <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="my-app-key"></script>

        then i took the script for embed script in  af folder and add itto my document

        Dropbox.embed({link:"https://www.dropbox.com/sh/keptcjl08q3wsid/AACui966iXcXPbagCJ2py2L-a?dl=0"}, element)

        Then i took the anchor tag <a> example you have on the page and addet into my document and changed the link to be the same as  the link in the "embed preview of folder"

         

               <a 
          href="https://www.dropbox.com/sh/keptcjl08q3wsid/AACui966iXcXPbagCJ2py2L-a?dl=0" 
          class="dropbox-embed"
        ></a>

        What i am missing?

         

        If i remove the a tag, then nothing happens and nothing shows up. If i add it then i still got the same error

        Blocked for politics x-frame-options, in danish "Blokeret af politik for X-Frame-Options"