Google Drive API 範例
本節提供 Google Drive API 的範例。
如需 Drive API 的入門影片,請參閱 Drive API 影片資料庫。
Google 在 GitHub 上代管以下範例。您可以分支這些存放區,並使用程式碼做為專案的參考依據。
Google Picker
Google Picker 程式碼範例說明如何使用圖片選取器或上傳頁面,讓使用者可透過網路應用程式中的按鈕開啟。
如要查看或下載原始碼,請前往 GitHub 存放區中的 Google Picker。
使用 Quickeditor 開啟及儲存檔案
這個 Quickeditors 程式碼範例說明如何使用 Drive API 開啟及儲存檔案。
每個 Drive 平台專屬範例都會反映單一範例應用程式:名為 Quickeditor 的文字編輯器,可編輯 MIME 類型 text/*
的雲端硬碟檔案。網頁版實作了兩種基本的 Google 雲端硬碟用途:
這兩種用途的流程相似,使用者從建立選單或含有已註冊 MIME 類型的檔案內容選單中選取應用程式後,雲端硬碟會將使用者重新導向至該應用程式。
如要查看或下載來源,請前往 GitHub 存放區的 Drive Quickeditors。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-21 (世界標準時間)。
[null,null,["上次更新時間:2024-12-21 (世界標準時間)。"],[[["This section provides Google Drive API samples, including code for integrating Google Picker and Quickeditors into web applications."],["The Google Picker sample demonstrates how to implement an image selector or upload page within a web app."],["Quickeditors samples showcase opening and saving files with the Drive API, including integration with Drive UI's \"New\" and \"Open with\" functionalities."],["Source code for both Google Picker and Quickeditors is available on GitHub for reference and adaptation in your projects."]]],[]]