Updated on 2026-09-11 GMT+08:00

Symbolic Links

Similar to a Windows shortcut, a symbolic link improves flexibility in resource management and simplifies access to objects. You can create a symbolic link that points to another object. By clicking the link, you access the target object. Symbolic links are useful in the following scenarios:

  • Object migration: When an object's storage path changes, you may want clients to continue using the old path without updating code. A symbolic link provides a smooth transition and prevents service interruptions. For example, if a file moves from old-path/file.txt to new-path/file.txt, you can create a symbolic link at old-path/file.txt that points to new-path/file.txt. Clients can still access the file through old-path/file.txt.
  • Flexible access paths: You can create multiple symbolic links for the same file to provide different access paths without duplicating data. This reduces storage costs and simplifies file management.
  • Seamless file updates: Updating a file by overwriting it may cause brief unavailability or require complex switchover logic. A symbolic link enables a seamless transition. For example, if the original file is data/file.txt and the updated file is data/new-file.txt, you can create a symbolic link data/file.txt that points to data/new-file.txt. Clients continue to access the latest content through data/file.txt without changing service logic.
  • Simplified access to deep paths: Long or complex object paths are hard to remember. A short symbolic link provides a simple entry point to objects stored in deep or nested paths.

Constraints

This feature is supported only in certain regions (for example, CN East2). Refer to the console for the latest support status.

Category

Constraint

Functions

  • Symbolic links can be created only for buckets. They are not supported for parallel file systems.
  • Symbolic links cannot be replicated using cross-region or same-region replication.
  • Symbolic links do not support CDN cache refreshing. Changes to the target object cannot trigger CDN refresh through the symbolic link.
  • Symbolic links do not support server-side encryption.

Others

  • The target object can be an object or a folder, but it cannot be another symbolic link.
  • The name of a symbolic link cannot exceed 1,024 bytes.
  • After the target object is moved or deleted, it cannot be accessed through the symbolic link.

Important Notes

  • ETag of a symbolic link is calculated based on the name of the target object.
  • A symbolic link can be in the Standard, Infrequent Access, Archive, or Deep Archive storage class. Symbolic links do not need to be restored. If you attempt to restore a symbolic link, error 405 is reported, with a message OperationNotSupported. However, if the target object of a symbolic link is in the Archive or Deep Archive storage class, you must restore the target object before you can download (GetObject) it through the symbolic link.
  • Symbolic links are included in a bucket inventory. During bucket storage statistics collection, symbolic links are treated the same as common objects. The size of a symbolic link is the length of the target object name.
  • When a symbolic link is replicated to another bucket, and that bucket contains an object with the same name as the target object in the source bucket, the replicated symbolic link can access the target object in the destination bucket.
  • The metadata of a symbolic link is independent of that of the target object. For example, you can specify the Content-Type header when creating a symbolic link or by calling the API for modifying object metadata after the symbolic link is created. If Content-Type is not specified, the system sets it to binary/octet-stream for a symbolic link by default.

Required Permissions

Table 1 Permissions required for symbolic link operations

Operation

Required Permission

Creating a symbolic link

Requires the PutObject permission. When you create a symbolic link, the system does not check whether you have permission to access the target object.

Accessing the target object through a symbolic link

Performed through the HeadObject or GetObject API. The access permission for symbolic links follows the principle of least privilege. You must have the GetObject permission for both the symbolic link and the target object.

Obtaining information about a symbolic link

Performed through the GetSymlink API and requires the GetObject permission.

Copying a symbolic link

Requires the GetObject and PutObject permissions. Replication does not support modification, which means that the target object to which the symbolic link points cannot be changed through headers.

Deleting a symbolic link

Requires the DeleteObject permission. Deleting a symbolic link and deleting its target object are independent operations.

You are advised to use IAM or bucket policies for authorization. For details, see OBS Access Control Overview, Using IAM Custom Policies, or Configuring an Object Policy.

Interaction with Versioning

Versioning disabled:

  • When you create a symbolic link with the same name as an existing symbolic link in the same path, the new link overwrites the existing one.
  • When you create a symbolic link with the same name as an existing common object (not a symbolic link) in the same path, the common object is overwritten by the symbolic link.

Versioning enabled:

  • When you create a symbolic link with the same name as an existing symbolic link in the same path, the new link becomes the current version. The existing link becomes a historical version.
  • When you create a symbolic link with the same name as an existing common object (not a symbolic link) in the same path, the common object becomes a historical version.
  • After versioning is enabled for a bucket, symbolic links can have multiple versions. Each version has a unique version ID. Both current and historical versions can point to the same target object. If the target object also has multiple versions, a symbolic link can point only to the latest version of the target object. It cannot point to any historical versions.
Figure 1 Interaction between symbolic links and versioning

Operations Related to Symbolic Links