我想上传一个我在 blobstore 中的文件,我想发送给我在 Python 中的应用程序的用户。对于这个用户,我有帐户名称“xxx@gmail.com”和他们的密码。我怎么做不到这个?
我使用它,但不起作用:
def subirArchivoDrive (self,f):
# Create a client class which will make HTTP requests with Google Docs server.
client = gdata.docs.service.DocsService()
# Authenticate using your Google Docs email address and password.
client.ClientLogin('admin@onohat.es', 'xxxxxxxxxx')
urlfetch.set_default_fetch_deadline(45)
ms = gdata.MediaSource(file_path=f, content_type="text/plain")
client.UploadDocument(ms, "SERENOPROBANDO", f)
错误发生在以下行: ms = gdata.MediaSource(file_path=f, content_type="text/plain") 和 "f" 是:
self.fileName = files.blobstore.create(mime_type='application/octet-stream',_blobinfo_uploaded_filename=nombreCSV)
错误是:
2013-08-23 13:32:24.859 回溯(最近一次通话最后):E 2013-08-23 13:32:24.859 文件“/base/data/home/runtimes/python/python_dist/lib/python2.5/ dummy_thread.py”,第 51 行,在 start_new_thread E 2013-08-23 13:32:24.859 函数(*args,**kwargs)E 2013-08-23 13:32:24.859 文件“/base/data/home/ apps/s~ono-hat-vv2/1.369704550404323662/src/exportacion.py",第 271 行,原则上 E 2013-08-23 13:32:24.859 self.subirArchivoDrive(self.fileName) E 2013-08-23 13 :32:24.859 文件“/base/data/home/apps/s~ono-hat-vv2/1.369704550404323662/src/exportacion.py”,第 343 行,在 subirArchivoDrive E 2013-08-23 13:32:24.859 ms = gdata.MediaSource(file_path=f, content_type="text/plain") E 2013-08-23 13:32:24.859 文件 "/base/data/home/apps/s~ono-hat-vv2/1.369704550404323662/gdata/ init .py”,第 92 行,在初始化 E 2013-08-23 13:32:24.859 self.setFile(file_path, content_type) E 2013-08-23 13:32:24.859 文件“/base/data/home/apps/s~ono-hat-vv2/ 1.369704550404323662/gdata/初始化.py",第 103 行,在 setFile E 2013-08-23 13:32:24.859 self.file_handle = open(file_name, 'rb') E 2013-08-23 13:32:24.859 IOError: [Errno 13] Permission拒绝:'/blobstore/可写:AD8BvukgB3Fn-zPXCfo-R3MWqu0IL-WBaL6Pa1BbxTL9gGpC5mrmyRMWIbaVUYT1kPoFY1ykhe8GUVV_c1pmm7jlDRruK1UFT906QI-L6qyzgY1JASuOztZhtN3AleoU4VWIJlGNqkC9ykrToM8TaV_TqfNZEmLNDptpHrKl_IZlU_tnkfieihAizYT9ri7-fNl2LMHSMC4w9BhY3BKJs9jDnGnX91B9bqkbSty-G2sbLRAZZFo1it2nwgQxJdW9F4wqn2h9_Lg6fjka_myXLUrVWrQpc9V9sB3xX_NAY1YJ5QXDgP3cPKKg-doykPO4lIhTqRqZ2zyFUx-zRUJbcyzTMM_u9SmGGeVFMwLpTGEhuX9zA_N9_dMbPnxoV3Sd5ExkYZ1AZUbma6ZZmIJe-R2T4Htb5DbXDDtrrSojRx5Qgyio25tlP5h6sZSUrxvRT0TQK7IgjZxHSli3iagS7EEckcFe3Vp4t97BBHa-Bo0cPh3A4KZ5BFpRz0cP_dG9ntZfe7W1VBhCGZ6oyotzcFUXJUBMZal0rJ56zRIFIdIOnqbZf-PSC3RWp5F-oRbABnRnnRF4Rm3e1I1XGHWkZ2mX_kIBSoJKC8CxhZwRyInmbxcv2kqd1z53CjIW1vRH3_r0n6QhpfARqJc3vQ7Jhsxeycy_SQTuBKOfkXXTXAGdengBZ7qPi3nWZw-mCbnS9SgvoANd99X3hoUK2DfNJScWXLQ2BsPoUTO07ubNJwRJC86HRlLmNM5ToKYuRvPtmPpW9imht5uqIKpTx-2tcmArQNAHy9eYaSXzZsI5PAipl-CwgUkfGUqmU1svFvcM585X7XL3zt5P44pPUQqSsKE8GFNAxKWwSLp46p-qkxLBVvo7UwstYTja7SgX9L2cn89hptHRq4C7Rzy1u3r5i4HawvrFDeT5fSh9R-feHOqndQCS16bAFDKaknOZdSLX0iidGzyGEam_ZCMQneLm5GiXsu79q7RNUw'
问候。