Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

update/overwrite acl for a file(object)in amazon s3

Tags:

php

amazon-s3

acl

I have an option to upload the files into Amazon s3 in my website. When the user uploads the file, I am setting the acl using the putObjectFile function.

In EditMode: How do I overwrite/update the acl for the file that I am updating without reuploading the file?

Is there any function which updates the acl of the exsisting file (object).

The solution is needed in PHP. Any links to sample code/or any other solutions are appreciated.

like image 865
user612913 Avatar asked Nov 05 '22 02:11

user612913


1 Answers

Have you looked at the Amazon's SDK for PHP.

You can use update_object to update the ACL. http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#m=AmazonS3/update_object

Or you can do it directly using the REST API if you prefer: http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTObjectPUTacl.html.

like image 188
Geoff Appleford Avatar answered Nov 12 '22 20:11

Geoff Appleford