I am working on AWS EC2 Ubuntu machine with AWS PHP SDK V2.8 and cakephp V2.3. I am trying to download the object from AWS S3 to my AWS Server. It is working fine just a issue is How can I set permission 644 to 777 of the file.
Here is my code.
$saveAs = "/var/www/html/app/webroot/files/image/" . $result[$type][0]['id'] . "/" . $result[$type][0]['attachment'];
$key = "files/image/" . $result[$type][0]['id'] . "/" . $result[$type][0]['attachment'];
$result = $this->Amazon->S3->getObject(array(
'Bucket' => 'mytest.sample',
// 'Key' => 'avtar-auth_test_latest5.png',
'Key' => $key,
'version' => 'latest',
'SaveAs' => $saveAs
));
I also tried
$saveAs = "/var/www/html/app/webroot/files/image/" . $result[$type][0]['id'] . "/" . $result[$type][0]['attachment'];
$key = "files/image/" . $result[$type][0]['id'] . "/" . $result[$type][0]['attachment'];
$result = $this->Amazon->S3->getObject(array(
'Bucket' => 'mytest.sample',
// 'Key' => 'avtar-auth_test_latest5.png',
'Key' => $key,
'version' => 'latest',
'SaveAs' => chmod($saveAs,'0777')
));
0 comments:
Post a Comment