Reputation: 1264
I am trying to delete the files on Amazon s3 bucket using simpledb. But for some reason it does not delete the file and says that it has deleted it.
I am using S3 classdeleteObject method to delete the file. Below is the sample code :
$bucketName = "bucket";
$s3 = new S3($awsAccessKey, $awsSecretKey);
if ($s3->deleteObject($bucketName, $url))
{
echo "deleted url";
}
else
{
echo "cannot delete";
}
After execution the script echoes "deleted url" which should happen when deletion is successfully completed. But when I open the URL again, the file is still there and has not been deleted.
Please help.
Thanks a lot.
Upvotes: 0
Views: 359
Reputation: 6935
You are using the unofficial S3.php class. The GitHub repo with documentation is here: https://github.com/tpyo/amazon-s3-php-class
This code is not provided by AWS, and should not be confused with either AWS SDK for PHP 1.x or AWS SDK for PHP 2.x.
Upvotes: 1
Reputation: 4649
Make sure you are giving the right file name for the object
in parameter
. I guess, you are storing file in Amazon S3
and you are keeping the URL
of that file into Amazon SimpleDB
. So you need to provide a valid file name
in parameter instead of URL
.
Upvotes: 0