Updated on 2024-08-15 GMT+08:00

Accessing OBS Using a Temporary URL

You can share a temporary URL to allow other users to access OBS to create buckets and upload and download objects. For details, see Using a URL for Authorized Access. This section describes how to share a temporary URL to allow other users to temporarily access objects.

Sharing Objects

You can share a temporary URL to allow other users to access objects (files or folders) for only a specified period of time.

Sharing a file

You can share a temporary URL to allow other users to access a file for a specified period of time.

A temporary URL consists of a domain name and the temporary authentication information of a file, for example:

https://bucketname.obs.cn-north-4.myhuaweicloud.com:443/image.png?AccessKeyId=xxx&Expires=xxx&response-content-disposition=xxx&x-obs-security-token=xxx&Signature=xxx

Temporary authentication information contains the AccessKeyId, Expires, x-obs-security-token, and Signature parameters. The AccessKeyId, x-obs-security-token, and Signature parameters are used for authentication. The Expires parameter specifies the validity period. For details about the temporary authentication method and parameters, see Authentication of Signature in a URL in Object Storage Service API Reference. A temporary URL also contains the response-content-disposition parameter that defines whether an object is to be downloaded or previewed in a browser. The browser obtains the value of response-content-disposition based on the Content-Type of the shared object.

After an object is shared on the OBS console, the system will generate a URL that contains the temporary authentication information. This URL is valid for five minutes since its generation. If you change the validity period of a URL, OBS obtains the authentication information again to generate a new URL for sharing. This new URL takes effect since when the validity period was changed.

Sharing a folder

Folder sharing is temporary and has a validity period. Folders can be temporarily shared by access code or URL:

  • By access code: Specify a six-digit access code before creating a sharing task. After the sharing task is created, OBS adds the download links of all objects in the folder to a static website that is hosted in a public OBS bucket. Then users can use the temporary URL and access code to access the static website to download files.
  • By URL: Specify a validity period and then share the generated link with others. Anyone can use a signature to access all objects in the shared folder.

Limitations and Constraints

  • A file or folder shared through OBS console is valid for one minute to 18 hours. If you need a longer validity period, you can use OBS Browser+ to set a validity period of up to one year. If you want to allow permanent access, you can set a bucket policy to grant all accounts the read permission for it.
  • Only buckets of version 3.0 support file and folder sharing. You can view the bucket version in the Basic Information area on the Overview page of a bucket.
  • File objects in the Archive or Deep Archive storage can be shared only after they are restored. Folder objects in the Archive or Deep Archive storage can be shared after they are restored to their original bucket.

Configuration Procedure

For details about how to share files and folders, see Temporarily Sharing Objects with All Accounts.