I\'m trying to delete a folder created as a result of a MapReduce job. Other files in the bucket delete just fine, but this folder won\'t delete. When I try to delete it from
Firstly, read the content of directory from getBucket
method, then you got a array list of all files, then delete the file from deleteObject
method.
if (($contents = $this->S3->getBucket(AS_S3_BUCKET, "file_path")) !== false)
{
foreach ($contents as $file)
{
$result = $this->S3->deleteObject(AS_S3_BUCKET,$file['name']);
}
}
$this->S3
is S3 class object, and AS_S3_BUCKET
is bucket name.