Amazon S3 and Subdirectories
I recently got a question from someone regarding how one can make subdirectories in Amazon S3. Amazon has only one level of directories, called “buckets”. There are no subdirectories, and you cannot put buckets in buckets. However, you can fake subdirectories by cleverly naming your resources.
For instance, say you have claimed a bucket named “mybucket”. Everything you place in the bucket would be accessible from the URL, http://s3.amazonaws.com/mybucket. Now, if you wanted to place an image resource deeply nested into a heirarchy, you couldn’t. But, if you name your resource path/to/my/resource.jpg, you can access it from http://s3.amazonaws.com/mybucket/path/to/my/resource.jpg. Voila!


