Skip to main content

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.

The folder name is a prefix in the object name. If an object is located in several nested folders, all folders make up the prefix. The prefix is included in the object name when working with the storage via command-line utilities and the API. When a folder is renamed, every object in it is effectively renamed.

note

For example, a folder Folder1 is created in a bucket, containing a folder Folder2. The object Object.txt is located in the folder Folder2. The full name of the object is Folder1/Folder2/Object.txt; it must be specified when accessing via API and console clients. In the object name, Folder1/Folder2/ is a prefix.

All objects in a folder inherit the bucket's properties.

A folder can be copied, moved, and deleted.

Create a folder

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to Buckets.
  3. Open the bucket page → Objects tab.
  4. Click Create folder
  5. Enter the folder name.
  6. Click Create.

Move a folder

When moving a folder, it is effectively copied to another folder and deleted from the current one.

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to Buckets.
  3. Open the bucket page → Objects tab.
  4. If versioning is enabled or suspended in the bucket, make sure that the Versions toggle switch is disabled. You cannot move a folder with the toggle switch enabled.
  5. In the folder's menu, select Move.
  6. Open the folder you want to move the folder into.
  7. Click Paste into current folder.
  8. If versioning is enabled or suspended in the bucket, turn on the Versions toggle switch and make sure that objects from the moved folder have been deleted.

Copy a folder

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to Buckets.
  3. Open the bucket page → Objects tab.
  4. If versioning is enabled or suspended in the bucket, make sure that the Versions toggle switch is disabled. You cannot copy a folder with the toggle switch enabled.
  5. In the folder's menu, select Copy.
  6. Open the folder you want to copy the folder into.
  7. 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 with versioning enabled or suspended⁠ section of the Delete object instructions. When deleting a folder, objects are deleted without specifying a version.

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to Buckets.
  3. Open the bucket page → Objects tab.
  4. If versioning is enabled or suspended in the bucket, make sure that the Versions toggle switch is disabled. You cannot delete a folder with the toggle switch enabled.
  5. In the folder's menu, select Delete folder.
  6. Enter the folder name and click Delete.
  7. If versioning is enabled or suspended in the bucket, turn on the Versions toggle switch and make sure that the objects in the folder have been deleted.