0

I want to add a Google Drive folder view and download to my website hosted in Wordpress.com. I followed the instructions in this question using this command:

<iframe src="https://drive.google.com/embeddedfolderview?id=FOLDER-ID#list" style="width:100%; height:600px; border:0;"></iframe> 

But for some reason it works when I preview it, but not when I publish it. Does anyone know how I can fix this?

This is the code in html

The preview works

But when I publish it, this is the result

5
  • Can you try opening the console (Ctrl+Shift+i) and seeing if there is any log/message related to this? Commented Oct 8, 2019 at 7:21
  • @carlesgg97 sorry for my lack of knowledge, but could you indicate me how to do that? Commented Oct 10, 2019 at 6:33
  • Sure! Please head over to your webpage (after publishing it with the embedded folder). There, hit the keys (Ctrl, Shift, i) at the same time and a window should open to the right of your browser (Otherwise open the drop-down settings button on the top left, click more tools and developer tools). Afterwards, select Console if it is not already selected and please tell me if there are any errors appearing there. Commented Oct 10, 2019 at 7:38
  • Otherwise, if you prefer, you can publish the URL here so I may take a look at it. Commented Oct 10, 2019 at 8:42
  • @carlesgg97 thanks for your disposition. I can't copy them all but there is a bunch of errors saying "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT" A couple that say: "Uncaught object. "{"error":{"code":-1,"message":"A network error occurred, and the request could not be completed."}}" and one that says "A cookie associated with a cross-site resource at <URL> was set without the SameSite attribute". The webpage is pabloviollier.net/docencia Commented Oct 10, 2019 at 20:16

1 Answer 1

0

The code you currently have in your website is as follows:

<iframe src="https://drive.google.com/file/d/1HtDl8uOzH3qLJqnZ_18HE8kXeJhwMR8k/preview?usp=drivesdk" frameborder="0" width="640" height="480" marginheight="0" marginwidth="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe> 

Which uses the appropriate hyperlink (right after the src=) to embed a file, rather than a directory. However, you a trying to embed the latter.

To embed a directory use the following URL:

https://drive.google.com/embeddedfolderview?id=YOUR_FOLDER_ID#grid 

And if you prefer to embed a file use the following URL:

https://drive.google.com/file/d/YOUR_FILE_ID/preview 

The resulting code you should use in order to embed your folder would be as follows:

<iframe src="https://drive.google.com/embeddedfolderview?id=1HtDl8uOzH3qLJqnZ_18HE8kXeJhwMR8k#grid" frameborder="0" width="640" height="480" marginheight="0" marginwidth="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe> 
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply and your time! I used your code, but it still doesn't work :( It seems the problem is that I use wordpress.com without a business plan en.forums.wordpress.com/topic/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.