如何在网站中嵌入Google云端硬盘文件夹 [英] How to embed a Google Drive folder in a website

查看:142
本文介绍了如何在网站中嵌入Google云端硬盘文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站中嵌入Google云端硬盘中的文件夹。我无法找到嵌入代码或Google云端硬盘帮助文章中记录的任何内容。 解决方案

Google云端硬盘文件夹可以嵌入并显示在 list grid views:



列表视图



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




网格视图



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




Q :什么是文件夹ID(FOLDER-ID),我怎样才能得到它?



A :转到Google云端硬盘>>打开文件夹>>请在浏览器的地址栏中查看其URL。例如:

文件夹网址 https://drive.google.com/drive/folders/0B1iqp0kGPjWsNDg5NWFlZjEtN2IwZC00NmZiLWE3MjktYTE2ZjZjNTZiMDY2



文件夹ID :<
0B1iqp0kGPjWsNDg5NWFlZjEtN2IwZC00NmZiLWE3MjktYTE2ZjZjNTZiMDY2




需要权限的文件夹警告



<这项技术最适合公共访问的文件夹。只有与某些Google帐户共享的文件夹在以这种方式嵌入时会造成麻烦。在编辑时,会显示一条消息您需要权限,其中有些按钮可帮助您请求访问或切换帐户(或可能登录Google帐户)。这些按钮中的Javascript在Chrome中的 IFRAME 内无法正常工作。



阅读更多 https://productforums.google.com/forum/#!msg/drive/GpVgCobPL2Y/ _Xt7sMc1WzoJ


I have a folder in Google Drive that I'd like to embed in my website. I can't find an embed code or anything documented in Google Drive Help articles.

解决方案

Google Drive folders can be embedded and displayed in list and grid views:

List view

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


Grid view

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



Q: What is a folder ID (FOLDER-ID) and how can I get it?

A: Go to Google Drive >> open the folder >> look at its URL in the address bar of your browser. For example:

Folder URL: https://drive.google.com/drive/folders/0B1iqp0kGPjWsNDg5NWFlZjEtN2IwZC00NmZiLWE3MjktYTE2ZjZjNTZiMDY2

Folder ID:
0B1iqp0kGPjWsNDg5NWFlZjEtN2IwZC00NmZiLWE3MjktYTE2ZjZjNTZiMDY2

Caveat with folders requiring permission

This technique works best for folders with public access. Folders that are shared only with certain Google accounts will cause trouble when you embed them this way. At the time of this edit, a message "You need permission" appears, with some buttons to help you "Request access" or "Switch accounts" (or possibly sign-in to a Google account). The Javascript in these buttons doesn't work properly inside an IFRAME in Chrome.

Read more at https://productforums.google.com/forum/#!msg/drive/GpVgCobPL2Y/_Xt7sMc1WzoJ

这篇关于如何在网站中嵌入Google云端硬盘文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆