Method: files.export
將 Google Workspace 文件匯出為要求的 MIME 類型,並傳回匯出的位元組內容。請注意,匯出內容的大小上限為 10 MB。
HTTP 要求
GET https://www.googleapis.com/drive/v3/files/{fileId}/export
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
mimeType |
string
必要欄位。這項匯出作業要求格式的 MIME 類型。
|
回應主體
如果成功,此方法會以位元組形式傳回檔案內容。如需 Google Workspace 文件和 MIME 類型轉換格式的清單,請參閱「Google Workspace 文件和相應的匯出 MIME 類型」。
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.readonly
部分範圍受到限制,必須接受安全性評估,應用程式才能使用這些範圍。詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-04 (世界標準時間)。
[null,null,["上次更新時間:2024-09-04 (世界標準時間)。"],[[["Exports a Google Workspace document to the requested MIME type, returning the file content as bytes with a 10MB size limit."],["Requires providing the file ID as a path parameter and the desired MIME type as a query parameter in the GET request."],["The request body should be empty, and successful responses contain the exported file content in the specified format."],["Authorization is necessary using one of the specified OAuth scopes, some of which may require a security assessment."]]],["This describes exporting Google Workspace documents via a `GET` request to `https://www.googleapis.com/drive/v3/files/{fileId}/export`. The `fileId` is a required path parameter, and `mimeType` is a required query parameter specifying the desired export format. The request body must be empty. A successful response returns the file content as bytes, limited to 10MB. Authorization requires specific OAuth scopes, including `drive`, `drive.file`, `drive.meet.readonly`, or `drive.readonly`.\n"]]