【问题标题】:Downloading native documents from Google Drive从 Google Drive 下载本地文档
【发布时间】:2016-03-24 15:54:33
【问题描述】:

我想使用 Google Drive SDK 从 Google Drive 下载 本机 格式的文件(以便对它们进行一些操作,然后将它们上传回 Google Drive)。

显然,我可以使用导出链接转换为另一种格式(Office 等),但这意味着文件将从本机转换为 Office,然后再转换回本机格式(在上传期间)。我试图避免这种情况,因为我预计这不会保持 100% 的保真度。

我尝试了以下请求:

GET /drive/v2/files/1q7BYvDDYWwXXXXXXXxIxsuby0IrXe5L4?alt=media Authorization: Bearer ya29.XXXXXXXXXXXXXtKVg3P3zg

但我得到的回应是:

{ "error": { "errors": [ { "domain": "global", "reason": "badRequest", "message": "The specified file does not support the requested alternate representation.", "locationType": "parameter", "location": "alt" } ], "code": 400, "message": "The specified file does not support the requested alternate representation." } }

无法获取原始格式的文件内容是 Drive API 中的一个大“漏洞”。

【问题讨论】:

    标签: google-api google-drive-api


    【解决方案1】:

    无法下载原始格式的 Google 文档。您唯一的选择是导出到 HTML、Word、odt 等,然后重新导入。

    【讨论】:

      猜你喜欢
      • 2013-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-24
      • 2013-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多