Closed Lucathiel closed 8 years ago
Hello everybody,
I have an issue with the basic example script provide in the Amazon doc (http://zf2.readthedocs.org/en/latest/modules/zendservice.amazon.s3.html) which look like this:
public function testAWSUpload() { $my_aws_key = 'XXXXXXXXXXXXXXXXXXXXXXX'; $my_aws_secret_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$s3 = new S3\S3($my_aws_key, $my_aws_secret_key); $list = $s3->getBuckets();
In debug mode this code throw me an HTTP 403 Forbidden. Here is the request:
GET / HTTP/1.1 Host: s3.amazonaws.com Connection: close Accept-Encoding: gzip, deflate User-Agent: Zend\Http\Client Content-Type: application/xml Date: Thu, 08 Oct 2015 16:01:58 GMT Authorization: AWS XXXXXXXXXXXXXXXXXX:pyGz5Fjvqo2ahnmHq78/nfV5p9M=
And there is the response:
HTTP/1.1 403 Forbidden x-amz-request-id: F84DE8F4433CA8C3 x-amz-id-2: pK7eAIyPEIMtaYNWDUHLX8qIqRJVCdqKX6alDGlWJKL2ikKZTsKACkiP0mOt5jidYDJvQ2zAQJk= Content-Type: application/xml Transfer-Encoding: chunked Date: Thu, 08 Oct 2015 16:01:58 GMT Server: AmazonS3
2eb <?xml version="1.0" encoding="UTF-8"?>
SignatureDoesNotMatch
0
I test my AWS KEY and AWS SECRET KEY on this site who return me the good name and canonical ID: http://www.bucketexplorer.com/awsutility.aspx
Anobody have a clue on what's happening?
Thank you
Problem solved, the error occured because of date format.
Hello everybody,
I have an issue with the basic example script provide in the Amazon doc (http://zf2.readthedocs.org/en/latest/modules/zendservice.amazon.s3.html) which look like this:
public function testAWSUpload() { $my_aws_key = 'XXXXXXXXXXXXXXXXXXXXXXX'; $my_aws_secret_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
In debug mode this code throw me an HTTP 403 Forbidden. Here is the request:
GET / HTTP/1.1 Host: s3.amazonaws.com Connection: close Accept-Encoding: gzip, deflate User-Agent: Zend\Http\Client Content-Type: application/xml Date: Thu, 08 Oct 2015 16:01:58 GMT Authorization: AWS XXXXXXXXXXXXXXXXXX:pyGz5Fjvqo2ahnmHq78/nfV5p9M=
And there is the response:
HTTP/1.1 403 Forbidden x-amz-request-id: F84DE8F4433CA8C3 x-amz-id-2: pK7eAIyPEIMtaYNWDUHLX8qIqRJVCdqKX6alDGlWJKL2ikKZTsKACkiP0mOt5jidYDJvQ2zAQJk= Content-Type: application/xml Transfer-Encoding: chunked Date: Thu, 08 Oct 2015 16:01:58 GMT Server: AmazonS3
2eb <?xml version="1.0" encoding="UTF-8"?>
SignatureDoesNotMatch
0
I test my AWS KEY and AWS SECRET KEY on this site who return me the good name and canonical ID: http://www.bucketexplorer.com/awsutility.aspx
Anobody have a clue on what's happening?
Thank you