【发布时间】:2013-04-13 03:34:19
【问题描述】:
我开始使用 GooG Drive API。我已经成功完成了 quickstart.py 教程/示例。都很好。
显示在我的云端硬盘中的文件以云端硬盘“查看器”文件的形式打开,而不是我需要的可编辑文件。我猜它是 MIMEtype,但该文档是一个 .txt 文件,所以我不确定它应该设置为什么。那么我如何将它写为 Drive 可编辑文件类型???
谢谢
Dav-o
media_body = MediaFileUpload(FILENAME, mimetype='text/plain', resumable=True)
body = {
'title': 'My document',
'description': 'A test document',
'mimeType': 'text/plain'
}
file = drive_service.files().insert(body=body, media_body=media_body).execute()
pprint.pprint(file)
【问题讨论】:
标签: python file-upload google-drive-api google-docs-api