Make a file in s3 public using python and boto

后端 未结 4 1877
半阙折子戏
半阙折子戏 2021-02-18 21:20

I have thins link below, and when I try to acess it it appears an xml file saying \"Acess denied\".

And I need to go to aws managment console and make this part-00

4条回答
  •  北海茫月
    2021-02-18 21:53

    This should give you an idea:

    import boto.s3
    conn = boto.s3.connect_to_region('us-east-1')  # or region of choice
    bucket = conn.get_bucket('myFolder')
    key = bucket.lookup('uploadedfiles/2015423/part-00000')
    key.set_acl('public-read')
    

    In this case, public-read is one of the canned ACL policies supported by S3 and would allow anyone to read the file.

提交回复
热议问题