我正在使用Python2.7,我正在尝试将文件(.txt)上载到与我共享的文件夹中。
到目前为止,我可以上传到我的驱动器,但如何设置到哪个文件夹。我得到了这个文件的地址。
谢谢你
到目前为止这是我的密码def Upload(file_name, file_path, upload_url):
upload_url = upload_url
client = gdata.docs.client.DocsClient(source=upload_url)
client.api_version = "3"
client.ssl = True
client.ClientLogin(username, passwd, client.source)
filePath = file_path
newResource = gdata.docs.data.Resource(filePath,file_name)
media = gdata.data.MediaSource()
media.SetFileHandle(filePath, 'mime/type')
newDocument = client.CreateResource(
newResource,
create_uri=gdata.docs.client.RESOURCE_UPLOAD_URI,
media=media
)