amazon web services - AWS S3 - 403 forbidden reading file - Boto Python -


i can create file using boto:

s3 = boto.connect_s3(aws_access_key_id='xxxx', aws_secret_access_key='xxx') pb = s3.get_bucket(b_path) k = key(pb) k.name = f_path k.set_contents_from_string(content) 

when try read same file get:

boto.exception.s3responseerror: s3responseerror: 403 forbidden 

if go s3 web inteface, , set permissions read/write everyone, can access file.

ps: when create file, owner user not mine. problem?

if third party credentials used upload object your bucket then, default, bucket owner not have ownership of object (the third party does).

all can bucket owner in case list object , delete (which allowed because paying storage in bucket). in particular, cannot read or modify object's acl , cannot object (unless owner explicitly grants read permission or makes object public).

to have control on object, need uploader supply canned acl gives full control. uploader can supplying acl='bucket-owner-full-control' when calling put(). alternatively, believe can supply grantfullcontrol='xyz', indicating grantee.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -