How to access Amazon s3 private bucket object through Zend_Service_Amazon_S3

后端 未结 2 1169
孤街浪徒
孤街浪徒 2021-01-01 06:50

I have created a bucket on the amazon s3 and I kept some images in this bucket inside a folder. All the images are private and I am using Zend_Service_Amazon_S3 class of Zen

2条回答
  •  旧巷少年郎
    2021-01-01 07:47

    Try this: It will return the binary data for the file stored on the Amazon S3 Bucket.

    require_once 'Zend/Service/Amazon/S3.php';
    $s3 = new Zend_Service_Amazon_S3($my_aws_key, $my_aws_secret_key);
    echo $s3->getObject("my-own-bucket/myobject");
    

    Documentation is here: http://framework.zend.com/manual/de/zend.service.amazon.s3.html
    This is example #1

提交回复
热议问题