Friday, 15 May 2015

amazon web services - create empty folder S3 ruby SDK -


I want to create an empty folder in Amazon S3 using Ruby SDK. Ive read that there is no folder concept in S3, so to construct a folder theoretically you have only one empty object with an empty "/"

  s3 = Aws :: S3 :: Client new (region: 'EU-West-1', credentials: credits) s3.put_object (bucket: "my_bucket", key: "my_folder /")  

By doing this Creates an empty object on my bucket, but then if I try to upload a file like this:

  s3.put_object (bucket: "my_bucket", well Minister: "my_folder / myfile")  

It does not make a file in my final it keeps old empty object, and creates a folder and a file. Therefore the bucket structure is followed by two commands:

  my_bucket / my_folder my_folder / my_file  

Why is this happening? Why does this object repeat my_folder? How do I create an empty folder for later use?

Amazon S3 virtual folders exist in existence when any key contains a '/' S3 While browsing a bucket in the console, it scans objects objects for normal prefixes and then uses that prefix to show the subset of the bucket.

Looking at the following object key:

  • Photo / Family / Holiday.jpg
  • < Li> Video / Funny.mp4

Then show the Amazon S3 top-level folders "photo" and "video" if you delete the "video / funny.mp34" object, then The "Videos" directory will disappear.


No comments:

Post a Comment