文件已上载且file_id
已知:
media_body = MediaFileUpload(filepath, mimetype=mimetype)
body = {'name': os.path.basename(filepath), 'appProperties':{'my_key': 'my_value'}}
file = drive_service.files().create(body=body, media_body=media_body, fields='id, appProperties').execute()
file_id = file['id']
如何使用v3修改文件的appProperties
?在
有一个Google Drive API v3 Migration帖子,可以用来获得一些关于文档中没有涉及的事情的想法。这篇文章的垃圾/更新部分讨论了googledriveapiv3中的update
功能。
但是它是用Java而不是Python编写的。它建议使用空文件对象:File newContent = new File();
这次PHP的另一篇文章提到了update
方法和这个空文件方法:How to update file in google drive v3 PHP
如果这里有人能通过一些Python代码片段来引导我朝着正确的方向前进,我将不胜感激。在
下面的样品怎么样?为了更新
appProperties
,可以使用drive.files.update. 详细信息是here。在示例脚本:
如果我误解了你的问题,对不起。在
相关问题 更多 >
编程相关推荐