I am working on the AWS api and having an issue with the check for existing objects(FOLDERS).
I went through this question and it does not help me because I am using the latest updated SDK.
I searched the SDK and found this which should work i.e.
$chkFileExist = $s3->doesObjectExist($bucketName,'1024x768');
You may want to give a little more thought to the whole "flat file system". When I first started writing PHP to interface with the S3 API I was expecting to be able to iterate over a directory, and the files in each folder. That's not how it works though!
This is from Ryan Parman, one of the responses in a question you referenced:
"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."
If you have objects with the following paths:
If you check for existence of the object
s3://myBucket/myFolder/ it will return false since there is no object with that specific name.
It might be helpful to know more about why you want to create the folder if it doesn't exist, but if you want to place an object into S3 in a specific "folder", you can just use the