【发布时间】: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