0
votes

I'm trying to list my bucket in S3 throught my zend framework 3 application.

I've already install ZendService\Amazon\S3 via composer and I'm following this tutorial:

https://framework.zend.com/manual/2.4/en/modules/zendservice.amazon.s3.html

But when I access my function I get error 500.

My code is like this:

public function uploadFotoAction() {
    // $awsAccessKey value here
    // $awsSecretKey value here

    $s3 = new ZendService\Amazon\S3( $awsAccessKey, $awsSecretKey );

    return new JsonModel([
        'sucesso' => true
    ]);
}

I need to config something more?

1
When you compare what you're asking to the URL of the tutorial, do you not think you might be following an outdated tutorial? Try docs.zendframework.com/tutorials instead - rkeet
Thank you! But I'm having problems with the S3 class, the zend application is working fine. Do you know any good update tutorial for that? Thanks again ^^' - Nathália Pissuti

1 Answers

0
votes

So, there were two problems:

Instead of

ZendService\Amazon\S3( $awsAccessKey, $awsSecretKey );

Is necessary to use

\ZendService\Amazon\S3\S3( $awsAccessKey, $awsSecretKey );

The other problem is that my credentials didn't have permission to list buckets, so when I tried to do that it gives error 500