Updated on 2024-05-31 GMT+08:00

Accessing OBS Using a Temporary URL

You can use a temporary URL to access OBS and perform operations such as bucket creation or object upload and download. This section describes how to share objects using a temporary URL.

Sharing Objects

You can share objects (files or folders) stored in OBS with all users within a specified period.

Sharing a file

File sharing is temporary. All shared URLs are temporary with a validity period.

A temporary URL consists of the access domain name and the temporary authentication information of a file. 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

The 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 of the authentication. 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 directly downloaded or previewed in a browser when it is accessed. This is determined by the browser based on the Content-Type of the shared object.

After an object is shared through OBS Console, the system will generate a URL that contains the temporary authentication information, valid for five minutes since its generation by default. Each time when you change the validity period of a URL, OBS obtains the authentication information again to generate a new URL for sharing, which takes effect since the time when the validity period is changed.

Limitations and Constraints

  • A file shared through OBS Console is valid for one minute to 18 hours. If you need a longer validity period for a shared file, use the client tool OBS Browser+ that allows a validity period of up to one year. If you want the shared file or folder to be permanently accessed, use a bucket policy to grant anonymous users the public read permissions for it.
  • Only buckets 3.0 support file sharing. You can view the bucket version in the Basic Information area on the Overview page of a bucket.
  • With file sharing, objects in the Archive storage class can be shared only after they have been restored.

Configuration Procedure

For details about how to share files, see Temporarily Sharing Objects with Anonymous Users.