php - How do I give multiple users access to a single Amazon S3 account AND determine who's added a file? -
i have aws s3 account contains 3 buckets. need able generate access codes new user can access buckets , add/delete files (preferably own, not deal breaker).
i have managed far granting access new users using iam. however, when read metadata of uploaded objects (in php using aws sdk) owner comes main aws account.
i've read pages of documentation can't seem find relating determining owner (or uploader) of file was.
any advice or direction massively appreciated!
thanks.
if problem find owner of uploaded file.
you can pass owner info meta-data of uploaded file. check http://docs.amazonwebservices.com/amazons3/latest/dev/usingmetadata.html
in php code while uploading :
// instantiate class. $s3 = new amazons3(); $response = $s3->create_object( $bucket, $keyname2, array( 'fileupload' => $filepath, 'acl' => amazons3::acl_public, 'contenttype' => 'text/plain', 'storage' => amazons3::storage_reduced, 'headers' => array( // raw headers 'cache-control' => 'max-age', 'content-encoding' => 'gzip', 'content-language' => 'en-us', 'expires' => 'thu, 01 dec 1994 16:00:00 gmt', ), 'meta' => array( 'uploadedby' => 'user1', ) ) ); print_r($response);
check php api more info.
Comments
Post a Comment