["DeleteMarker"]=> bool(false)
["VersionId"]=> string(0) ""
["RequestCharged"]=> string(0) ""
["@metadata"]=> array(4) { ["statusCode"]=> int(204)
["effectiveUri"]=> string(115) "https://dde.s3.us-east-2.amazonaws.com/upload/gbs.jpg" ["headers"]=> array(4) { ["x-amz-id-2"]=> string(76) "HNZj7VPsQ8="
["x-amz-request-id"]=> string(16) "0D"
["date"]=> string(29) "Sat, 14 Dec 2019 09:05:11 GMT"
["server"]=> string(8) "AmazonS3" }
["transferStats"]=> array(1) { ["http"]=> array(1) { [0]=> array(0) { } } } } } ["monitoringEvents":"Aws\Result":private]=> array(0) { } }
Check is object deleted in console - if actually deleted -
it looks apk check exists after deleting that is why 204 no content status so use
function delete_s3_object($keyname){
try{
$s3 = s3client();
$result = $s3->deleteObject([
'Bucket' => 'dddd',
'Key' => $keyname
]);
var_dump($result);
if($result["@metadata"]["statusCode"] === 204){
return true;
}else{
return false;
}
} catch (S3Exception $e) {
return false;
}
}
No comments:
Post a Comment