我正在使用谷歌应用引擎并尝试制作一个存储驱动器中文件快捷方式的python应用
当我尝试在云端硬盘中创建快捷方式时,请按照文档中的代码进行操作..创建的文件始终具有mimetype'application / octet-stream',即使我指定'application / vnd.google-apps.drive- SDK”。
drive_service = build('drive', 'v2', http=http)
# Insert a shortcut
body = {
'title': 'shortcut',
'description': 'description',
'mimetype': 'application/vnd.google-apps.drive-sdk',
}
file = drive_service.files().insert(body=body).execute()
还有其他人有同样的问题吗?
答案 0 :(得分:4)
mimeType
区分大小写,大写T
:
body = {
'title': 'shortcut',
'description': 'description',
'mimeType': 'application/vnd.google-apps.drive-sdk',
}
引用files().insert()
documentation:
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.