Manage folders (prefixes)
S3 has a flat structure in which a folder entity does not technically exist, but for ease of working with the storage, you can create and view simulated folders in the control panel and GUI utilities.
A folder name is a prefix in an object name. If an object is located in several nested folders, all folders constitute the prefix. The prefix is included in the object name when working with storage via command-line utilities and the API. When renaming a folder, you are effectively renaming every object within it.
For example, a folder Folder1 is created in a bucket, which contains a folder Folder2. The object Object.txt is located in the folder Folder2. The full object name is Folder1/Folder2/Object.txt, which you must specify when accessing via the API and command-line clients. In the object name, Folder1/Folder2/ is the prefix.
All objects in a folder inherit the bucket's properties.
A folder can be copied, moved, and deleted.
Create a folder
- In the control panel, on the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Objects tab.
- Click Create folder
- Enter the folder name.
- Click Create.
Move a folder
When moving a folder, it is effectively copied to another folder and deleted from the current one.
- In the control panel, on the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Objects tab.
- If versioning is enabled or suspended in the bucket, ensure that the Versions toggle is disabled. You cannot move a folder with the toggle enabled.
- In the folder menu, select Move.
- Open the folder you want to move the folder into.
- Click Paste into current folder.
- If versioning is enabled or suspended in the bucket, turn on the Versions toggle and ensure that the objects from the moved folder have been deleted.
Copy a folder
- In the control panel, on the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Objects tab.
- If versioning is enabled or suspended in the bucket, ensure that the Versions toggle is disabled. You cannot copy a folder with the toggle enabled.
- In the folder menu, select Copy.
- Open the folder you want to copy the folder into.
- Click Paste into current folder.
Delete a folder
If versioning is enabled in the bucket, deleting a folder (deleting objects with a specific prefix) will create versions for the objects; for more details, see the Delete an object when versioning is enabled or suspended subsection of the Delete an object instruction. When you delete a folder, objects are deleted without specifying a version.
- In the control panel, on the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Objects tab.
- If versioning is enabled or suspended in the bucket, ensure that the Versions toggle is disabled. You cannot delete a folder with the toggle enabled.
- In the folder menu, select Delete folder.
- Enter the folder name and click Delete.
- If versioning is enabled or suspended in the bucket, turn on the Versions toggle and ensure that the objects in the folder have been deleted.