2015-12-24 216 views
1

我想使用Google Drive SDK(为了对它们执行某些操作并将它们上传到Google云端硬盘)从Google云端硬盘以本地格式下载文件。显然,我可以使用导出链接转换为另一种格式(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中是一个很大的“漏洞”。

回答

1

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

相关问题