問題描述
我想在我的網(wǎng)站中嵌入 Google 云端硬盤中的一個(gè)文件夾.我找不到嵌入代碼或 Google 云端硬盤幫助文章中記錄的任何內(nèi)容.
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 文件夾可以嵌入并顯示在 list
和 grid
視圖中:
Google Drive folders can be embedded and displayed in list
and grid
views:
<iframe src="https://drive.google.com/embeddedfolderview?id=FOLDER-ID#list" style="width:100%; height:600px; border:0;"></iframe>
<iframe src="https://drive.google.com/embeddedfolderview?id=FOLDER-ID#grid" style="width:100%; height:600px; border:0;"></iframe>
問:什么是文件夾ID(FOLDER-ID),如何獲取?
Q: What is a folder ID (FOLDER-ID) and how can I get it?
A:轉(zhuǎn)到 Google Drive >> 打開文件夾 >> 在瀏覽器的地址欄中查看其 URL.例如:
A: Go to Google Drive >> open the folder >> look at its URL in the address bar of your browser. For example:
文件夾網(wǎng)址:https://drive.google.com/驅(qū)動(dòng)器/文件夾/0B1iqp0kGPjWsNDg5NWFlZjEtN2IwZC00NmZiLWE3MjktYTE2ZjZjNTZiMDY2
文件夾 ID:
0B1iqp0kGPjWsNDg5NWFlZjEtN2IwZC00NmZiLWE3MjktYTE2ZjZjNTZiMDY2
Folder ID:
0B1iqp0kGPjWsNDg5NWFlZjEtN2IwZC00NmZiLWE3MjktYTE2ZjZjNTZiMDY2
此技術(shù)最適用于具有公共訪問權(quán)限的文件夾.僅與某些 Google 帳戶共享的文件夾在您以這種方式嵌入時(shí)會造成麻煩.在進(jìn)行此編輯時(shí),會顯示一條消息您需要權(quán)限",其中一些按鈕可幫助您請求訪問"或切換帳戶"(或可能登錄到 Google 帳戶).這些按鈕中的 Javascript 在 Chrome 中的 IFRAME
內(nèi)無法正常工作.
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.
在 https://productforums.google.com/forum 了解更多信息/#!msg/drive/GpVgCobPL2Y/_Xt7sMc1WzoJ
這篇關(guān)于如何在網(wǎng)站中嵌入 Google Drive 文件夾的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!