I want to delete a specific object from my bucket. I used this code for deleting. But this not working for me.
use Aws\S3\S3Client;
$s3 = S3Client::factory(array(
'key' => CONTENT_KEY,
'secret' => CONTENT_SECRET
));
$keyname = "/".CONTENT_PATH."/magazinename";
if ($s3->deleteObject(CONTENT_BUCKET, $keyname)) {
echo "Deleted file.";
}
I got an error that:
Catchable fatal error: Argument 2 passed to Guzzle\Service\Client::getCommand() must be an array