cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

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

ikenderham
Explorer | Level 3
Go to solution

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!

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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.

View solution in original post

7 Replies 7

Greg-DB
Dropbox Staff
Go to solution

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
Explorer | Level 3
Go to solution
Hello tanks for your reply. I did register the domain but it didnt work..

Greg-DB
Dropbox Staff
Go to solution

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

ikenderham
Explorer | Level 3
Go to solution

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"

 

Greg-DB
Dropbox Staff
Go to solution

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.

ikenderham
Explorer | Level 3
Go to solution

Thank you for that. It is working now.

 

I am trying to make a solution where users who is logged in can download files from the embedder. How can i secure that they cant save the dropbox link and use it in future, when they are dont logged in, in the future? 🙂

 

Can i disable "open in dropbox" button? 🙂

Greg-DB
Dropbox Staff
Go to solution

No, there isn't a way to disable that button, or hide the shared link itself. Since the Embedder operates by having the page supply the shared link, the user could just inspect the page's source to find the shared link anyway, even if that button wasn't shown.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    ikenderham Explorer | Level 3
What do Dropbox user levels mean?