update/overwrite acl for a file(object)in amazon s3
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开发者_C百科 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.
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.
精彩评论