If you want to organize the objects that you upload to a bucket, you can create directories. This topic describes how to create directories in the Object Storage Service (OSS) console.

Prerequisites

A bucket is created. For more information, see Create buckets.

Background information

When the hierarchical namespace feature is disabled for a bucket, OSS uses a flat structure instead of a hierarchical structure for objects. All elements are stored as objects in buckets. To help organize objects and simplify management, the OSS console displays objects whose names end with a forward slash (/) as directories. The objects can be uploaded and downloaded. You can use directories in the OSS console in the same manner as you use directories in Windows.

When the hierarchical namespace feature is enabled for a bucket, you can update a parent directory to perform multiple directory-level tasks at the same time. Traditionally, OSS uses a flat namespace to store objects in buckets and uses objects whose names end with a forward slash (/) to simulate directories. Compared with this method, the hierarchical namespace feature greatly improves the performance of operations that are related to directories. For more information about the hierarchical namespace feature, see Hierarchical namespace.

Procedure

  1. Log on to the OSS console.
  2. In the left-side navigation pane, click Buckets. On the Buckets page, click the name of the bucket in which you want to create a directory.
  3. In the left-side navigation pane, choose Files > Files.
  4. On the Files page, click Create Folder.
  5. In the Create Folder panel, enter a directory name in the Folder Name field.
    The directory name must meet the following conventions:
    • The directory name must be UTF-8 characters and cannot contain emoticons.
    • Forward slashes (/) are used in a directory name to indicate subdirectories. You can specify a directory name that contains multiple forward slashes (/) to create subdirectories in the directory. The directory name cannot start with a forward slash (/) or a backslash (\). The directory name cannot contain consecutive forward slashes (/).
    • The name of a subdirectory cannot be two consecutive periods (..).
    • The directory name must be 1 to 254 characters in length.
  6. Click OK.