Google drive api 将零大小文件上载到google drive

Google drive api 将零大小文件上载到google drive,google-drive-api,google-docs-api,Google Drive Api,Google Docs Api,我使用gdatapython客户端上传/下载文件。我不知道如何上传零大小的文件。这是我的 #To update file = gdata.data.MediaSource() r = client.GetResourceById(resid) client.UpdateResource(r, media=file, new_revision=True) #To create a new file file = gdata.data.MediaSource() doc = gdata.docs.

我使用gdatapython客户端上传/下载文件。我不知道如何上传零大小的文件。这是我的

#To update
file = gdata.data.MediaSource()
r = client.GetResourceById(resid)
client.UpdateResource(r, media=file, new_revision=True)

#To create a new file
file = gdata.data.MediaSource()
doc = gdata.docs.data.Resource(type='file', title="Title")
r = client.CreateResource(doc, create_uri=uri, media=file)

我尝试过删除媒体=无,也没有包括在选项中。如何使其适用于零大小的文件

您可以将代码段用于
文件。插入驱动器API的
方法,而不指定
媒体体
来创建空文件:


谢谢。我正在寻找基于gdata的解决方案。我的代码库已经使用gdata,我希望避免立即更改为新的api。谢谢