download free 30 days trial version buy bucket explorer
Documentation  Download  Purchase  Support  FAQs   Forum   ScreenShots & Demos

Amazon S3 - How to Create a Folder?

It is important to know that there is no concept of Folders at Amazon S3. These are just long S3 File names with slashes within them, which are used to group Amazon S3 Objects . However, Bucket Explorer, displays these as folders, which makes the organization of your data better.

Similar to a computer file system; you can put folders inside a folder. You can perform all Amazon S3 operations on a folder like upload , download , update ACL , update Metadata , etc. and when you name a folder, this folder name becomes a part of the URL of the object in it. Operations are also applied on a Folder as on other S3 Objects.

You can create a folder, by sending Http PUT Object Request to Amazon S3 Server, in one of the two ways explained below:

  1. Create new folder using Amazon S3 REST API "PUT Object"- Software programmers can write a program to create a new folder using Amazon S3 REST API- PUT Object in the code.
  2. Create new folder using Bucket Explorer- If you do not want to write code, you can easily create new folder using Bucket Explorer on a single mouse click.

Creating a Folder using Amazon REST API- PUT Object

By sending PUT Object request you can create a folder. In the request, you need to put "/" in its name, then strings separated by "/" and file size is zero. To authenticate the request, you must have WRITE permissions on the Bucket. In PUT Object request, you don't need to use any Request parameter except common Requester headers.

Syntax:

PUT / ObjectName/ HTTP/1.1
Host: BucketName .s3.amazonaws.com
Date: date
Authorization: signatureValue
Note: append "/" at the end of name of folder
 

Creating a Folder using Bucket Explorer

While the "PUT Object" API of AWS allows you to create a folder, Bucket Explorer lets you do that easily without the need to write any code.
To create a folder, follow the steps below:

  1. Run Bucket Explorer and connect with your Amazon S3 account.
  2. In the Buckets list, click on the Bucket in which you want to create a folder. Click on New Folder option.
  3. A panel opens asking for the name of the folder. Type the name of the folder then click on the OK button.
  4. The folder with the given name will be created.

Deleting a Folder

There is no concept of Folder at Amazon S3. It is simply an Amazon S3 object with its name ending with a forward slash. Bucket Explorer visualizes these types of Amazon S3 Objects as a folder. So in Bucket Explorer, folder contains group of Amazon S3 Objects whose file name starts with folder name prefix and when deleting a folder, it will delete all Amazon S3 Objects into that folder.

You can delete a folder, by sending Http DELETE Object Request to Amazon S3 Server, in one of the two ways explained below:

  1. Delete folder using Amazon S3 REST API "DELETE Object"- If you are a programmer, you can write a program to delete an Amazon S3 object using Amazon S3 REST API- Delete Object in your application code.
  2. Delete folder using Bucket Explorer- If you do not want to write code, you can easily delete folder using Bucket Explorer on a single mouse click.

Delete a Folder using Amazon REST API- DELETE Object

To delete a folder, you can request DELETE Object. If you would like to delete all Amazon S3 Objects whose names start with folder name prefix, first you can look them up with GET BUCKET and then delete each individual S3 Objects using DELETE Object request. To authenticate the request, you must be a valid registered AWS account holder.

Syntax:

DELETE / ObjectName/ HTTP/1.1
Host: BucketName .s3.amazonaws.com
Date: date
Content-Length: length
Authorization: signatureValue
 

Delete a Folder using Bucket Explorer

While the "DELETE Object" API of AWS allows you to delete a folder by writing codes, Bucket Explorer let you do that easily. In Amazon S3, when you delete a folder, all the objects or folders contained in the folder will also be deleted automatically. To be able to keep those objects or folders, you need to move them elsewhere or to a different folder before you delete the folder.

To delete a folder, follow the steps below:

  1. Run Bucket Explorer and get authenticated into your Amazon S3 account.
  2. List the objects of a Bucket.
  3. In the Objects and Folders list, right click on that folder which you want to delete and click on " Delete File -> Delete File(s) .
  4. It will ask you with “Move to Trash” option (if Amazon S3 Versioning is not enabled on your Bucket; otherwise, you will get a “Delete” option)
  5. Click Delete on the confirmation message that appears.
  6. Chosen folder gets deleted.