使用 Python 将文件上传到 Google 文档时出现错误 403
我在尝试将文件上传到 Google 文档时遇到 403 错误 使用Python / gdata-2.0.13:
import gdata.docs.data
import gdata.docs.client
client = gdata.docs.client.DocsClient(source="MyUpdater")
client.ClientLogin("[email protected]", "mykey", client.source);
client.http_client_debug = True
ms = gdata.data.MediaSource(file_path="g:/Python/Utiles/test.doc", content_type="application/msword'")
entry = client.Upload(ms, "Test File")
# Error:
gdata.client.RequestError: Server responded with: 403, <errors xmlns='http://sch
emas.google.com/g/2005'><error><domain>GData</domain><code>ServiceForbiddenExcep
tion</code><internalReason>You do not have permission to perform this operation.
</internalReason></error></errors>
...
我尝试下载文件,没有问题。我使用的是常规 Gmail 帐户(例如,没有 Google Apps 或付费帐户)。
有什么想法吗? TIA, 巴勃罗
I'm having a 403 error when trying to upload a file to Google Docs
with Python / gdata-2.0.13:
import gdata.docs.data
import gdata.docs.client
client = gdata.docs.client.DocsClient(source="MyUpdater")
client.ClientLogin("[email protected]", "mykey", client.source);
client.http_client_debug = True
ms = gdata.data.MediaSource(file_path="g:/Python/Utiles/test.doc", content_type="application/msword'")
entry = client.Upload(ms, "Test File")
# Error:
gdata.client.RequestError: Server responded with: 403, <errors xmlns='http://sch
emas.google.com/g/2005'><error><domain>GData</domain><code>ServiceForbiddenExcep
tion</code><internalReason>You do not have permission to perform this operation.
</internalReason></error></errors>
...
I tried downloading files, no problem there. I'm using a regular Gmail account (eg, no Google Apps or paid account).
Any ideas?
TIA,
Pablo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)