Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud storage 将文件上载到谷歌云存储<;HttpError 403“;许可不足“&燃气轮机;_Google Cloud Storage - Fatal编程技术网

Google cloud storage 将文件上载到谷歌云存储<;HttpError 403“;许可不足“&燃气轮机;

Google cloud storage 将文件上载到谷歌云存储<;HttpError 403“;许可不足“&燃气轮机;,google-cloud-storage,Google Cloud Storage,下面是从google云存储上传和下载文件的python代码示例。我可以从云端下载一个文件,但使用相同的python文件,当我试图上传一个文件时,我得到以下错误。您认为是什么导致了权限错误吗 谢谢! 亚当 storage file transfer json python master adamkglaser$python chunked_transfer.py language_id.txt gs://adam_glaser_cloud_storage/test.txt 验证。。。 正在构建谷歌

下面是从google云存储上传和下载文件的python代码示例。我可以从云端下载一个文件,但使用相同的python文件,当我试图上传一个文件时,我得到以下错误。您认为是什么导致了权限错误吗

谢谢! 亚当

storage file transfer json python master adamkglaser$python chunked_transfer.py language_id.txt gs://adam_glaser_cloud_storage/test.txt
验证。。。
正在构建谷歌云存储服务。。。
正在生成上载请求。。。
上传文件:language_id.txt到bucket:adam_glaser_cloud_存储对象:test.txt
回溯(最近一次呼叫最后一次):
文件“chunked_transfer.py”,第217行,在
上传(sys.argv)
上传文件“chunked_transfer.py”,第148行
进度,响应=request.next_chunk()
文件“/Users/adamkglaser/anaconda/lib/python2.7/site packages/oauth2client/util.py”,第132行,在位置包装中
已包装退货(*args,**kwargs)
文件“/Users/adamkglaser/anaconda/lib/python2.7/site packages/apiclient/http.py”,第808行,在下一块中
提出可恢复性建议(分别,内容)
apiclient.errors.ResumableUploader:

您是否引用了此示例:?是的,就是这个示例。我可以下载文件,但由于某些原因无法上传。不确定是什么导致权限错误。您是否使用拥有该存储桶的凭据填写了
client\u secrets.json
?是的,我对这个问题感到困惑。它们也必须是正确的,因为我可以从bucket下载文件,但不能上传。在任何情况下,我们都在我的办公室(我知道其中的细节)使用代理,并且环境变量http\u proxy、https\u proxy等都已正确设置。今天上午,我决定继续使用gsutil。在创建配置文件时,使用gsutil config-b我能够生成一个工作的.boto文件,该文件还包括正确的代理信息。这是可行的,不确定为什么这个python示例失败,但我将继续使用gsutil!
storage-file-transfer-json-python-master adamkglaser$ python chunked_transfer.py language_id.txt gs://adam_glaser_cloud_storage/test.txt
Authenticating...
Constructing Google Cloud Storage service...
Building upload request...
Uploading file: language_id.txt to bucket: adam_glaser_cloud_storage object: test.txt 
Traceback (most recent call last):
  File "chunked_transfer.py", line 217, in <module>
    upload(sys.argv)
  File "chunked_transfer.py", line 148, in upload
    progress, response = request.next_chunk()
  File "/Users/adamkglaser/anaconda/lib/python2.7/site-packages/oauth2client/util.py", line 132, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Users/adamkglaser/anaconda/lib/python2.7/site-packages/apiclient/http.py", line 808, in next_chunk
    raise ResumableUploadError(resp, content)
apiclient.errors.ResumableUploadError: <HttpError 403 "Insufficient Permission">