I know that S3 buckets really have no directories because the storage is flat. But you can create directories programmatically using python / boto3, but I don't know how to do this. I saw this in a documentary:
“Although the S3 storage is flat: there are keys in the buckets, S3 allows you to overlay the directory tree structure on your bucket using the separator in your keys. For example, if you name the key 'a / b / f and use' / as a separator, then S3 will be assume that 'a is a directory,' b is a subdirectory of 'a, and' f is a file in 'b. "
I can only create files in the S3 bucket:
self.client.put_object(Bucket=bucketname,Key=filename)
but I do not know how to create a directory.
python amazon-s3 amazon-web-services boto3
Steve ritz
source share