I use ListObject function without any delimiters and as result I have something that look like:
/BF
/BF/FTP
/BF/MUSIC/LIBRARY/AUDITION/BEAKING%20EARLY.MP3
/BF/VIDEO/
/BF/VIDEO/Example
/BF/VIDEO/Example/test.mp4
The problem is in the music folder. Why ListObjects doesn't return S3Object with key: "/BF/MUSIC". There are many S3Objects with the same problem. Why is that happening?
The reason is S3 actually has a flat structure. There are no folders but it just recognizes the forward slashes so groups the ones having the same prefix under same folder. So in your example "/BF/MUSIC" would be just another object, not an empty folder.
In Amazon S3, buckets and objects are the primary resources, where objects are stored in buckets. Amazon S3 has a flat structure with no hierarchy like you would see in a typical file system. However, for the sake of organizational simplicity, the Amazon S3 console supports the folder concept as a means of grouping objects. Amazon S3 does this by using key name prefixes for objects.
Source: AWS Documentation: Working with Folders
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With