Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant use the upload of the s3 service #35

Open
ITOoscarestupinan opened this issue Mar 13, 2015 · 0 comments
Open

Cant use the upload of the s3 service #35

ITOoscarestupinan opened this issue Mar 13, 2015 · 0 comments

Comments

@ITOoscarestupinan
Copy link

Hello everyone,

I'm having an issue, i'm trying to upload a file to an amazon s3 server.

$pdf=$rootdir . '/../web/uploads/pdf/'.$reference.'.pdf';
$s3 = $this->container->get('aws_s3');
$bucket = 'my-bucket';
$headers = $s3->get_object_headers($bucket, $pdf);
var_dump($headers->header['content-type']);
$response = $s3->update_object($bucket, $pdf, array(
'acl' => AmazonS3::ACL_PUBLIC,
'headers' => array(
'Content-Encoding' => 'UTF-8'
),
'meta' => array(
'Cache-Control' => 'Public',
'Max-Age' => '604800',
),
));
var_dump($response->isOK());

But always send me this error:

Warning: Cannot unset offset in a non-array variable in /root/dir/to/my/vendor/amazonwebservices/aws-sdk-for-php/services/s3.class.php line 1881

What i'm doing wrong? i take the example from here : http://docs.aws.amazon.com/AWSSDKforPHP/latest/#m=AmazonS3/update_object

Hope someone could help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant