I am using amazon S3 PHP SDK, i need to check wither an object exists or not,
$response = $s3->if_object_exists($bucket, '/albums/Carcassonne-France/');
var_dump($response); //RESPONSE FALSE
But when is see using S3 Browser in firefox the specified object exists
$response = $s3->if_object_exists($bucket, '/albums/Carcassonne-France/1.jpg');
var_dump($response); //RESPONSE TRUE
but this shows True, as i have 1.jpg at the above location, but i wan to check the below if the specified path exists or not.
$response = $s3->if_object_exists($bucket, '/albums/Carcassonne-France/');
How can i check the sepecified path exists or not ?
S3 is a flat file system. There are no folders. There are simply filenames with slashes in them. Some S3 browsing tools choose to display the concept of "folders" in their software, but they're just pretend.
"/albums/Carcassonne-France/" returns false because there is not a singular object with that name.