【发布时间】:2019-10-28 20:56:19
【问题描述】:
我想定期从 Google 云端硬盘上的共享团队云端硬盘下载和上传文件。我可以上传到文件夹,但不能下载。
这是我尝试过的
team_drive_id = 'YYY'
file_to_download= 'ZZZ'
parent_folder_id = 'XXX'
f = drive.CreateFile({
'id':file_to_download,
'parents': [{
'kind': 'drive#fileLink',
'teamDriveId': team_folder_id,
'id': parent_drive_id
}]
})
f= drive.CreateFile({'id': file_to_download})
f.GetContentFile('test.csv', mimetype='text/csv')
但这就是我得到的:
ApiRequestError: <HttpError 404 when requesting https://www.googleapis.com/drive/v2/files/file_to_download?alt=json returned "File not found: file_to_download">
有什么建议吗?
【问题讨论】:
-
您确定路径
test.csv的文件正确且文件存在。因为这就是错误所说的 -
我的路径错了,感谢@UliSotschok的帮助