tpyo/amazon-s3-php-class — Issue #24: MAKE FILE PUBLIC
Author: isimpledesign
Created: 2012-03-09 14:45:47+00:00
State: open

Hi

I am trying to make all file in a bucket public so i can make the stream i am not able to do this with the following code.

putBucket($bucket, S3::ACL_PUBLIC_READ);

if (($contents = $s3->getBucket($bucket)) !== false) {

foreach ($contents as $object) {

$fname = $object['name'];

if (($acp = S3::getAccessControlPolicy($bucket,$fname)) !== false) {

echo "

";
print_r($acp);
echo "

";
// Here you would modify the $acp array...
// For example, grant access to the S3 LogDelivery system:
$acp["acl"][] = array(
"type" => "Group", "uri" => "http://acs.amazonaws.com/groups/s3/LogDelivery", "permission" => "FULL_CONTROL"
);
// Then update the policy using the modified $acp array:
if (S3::setAccessControlPolicy($bucket, $fname, $acp)) {
echo $fname . "Policy updated";
}
}

}

}

?>

Can you help with this???