This topic describes how to obtain the URL of an uploaded object.

Public read object

If anonymous users are allowed to access the object, the URL format of the object is https://BucketName.Endpoint/ObjectName.

For example, the example.jpg object is in the example folder of the bucketexample bucket in the China (Hangzhou) region. The URL of the object:
  • URL for access over the Internet: https://bucketexample.oss-cn-hangzhou.aliyuncs.com/example/example.jpg
  • URL for access over the internal network (from ECS instances that are located in the same region as the object): https://bucketexample.oss-cn-hangzhou-internal.aliyuncs.com/example/example.jpg
Note
  • For more information about region endpoints, see Regions and endpoints.
  • ObjectName indicates the complete path of the object, in which the folder (if any) and the suffix of the object are also included.

Private object

If the bucket ACL is private, you must sign the URL. The URL format of the object is https://BucketName.Endpoint/Object?SignatureParameters. You can obtain the URL of an object and set the validity period of the URL in any of the following ways:
  • OSS console

    For more information, see Download objects in OSS Console User Guide. If you use an Alibaba Cloud account to obtain the URL from the OSS console, the maximum validity period of the URL is 32,400 seconds (9 hours). If you use the credentials of a RAM user or STS user to obtain the URL from the OSS console, the maximum validity period of the URL is 3,600 seconds (1 hour). To obtain a URL with a longer validity period, we recommend that you use ossutil, ossbrowser, or SDKs.

  • ossutil

    For more information, see ossutil-sign.

  • ossbrowser

    For more information, see Quick start.

  • SDK
    For more information, see the following topics:

Custom domain name bound to an object

If the bucket to which the object belongs is bound to a custom domain name, the URL format of the object is https://YourDomainName/ObjectName.

For example, the example.jpg object is in the example folder of the bucketexample bucket in the China (Hangzhou) region, and you have the img.example.com domain name:
  • If you do not bind the custom domain name to the bucket, the object URL is https://bucketexample.oss-cn-hangzhou.aliyuncs.com/example/example.jpg.
  • If you have bound the custom domain name to the bucket, the object URL is https://img.example.com/example/example.jpg.
Note ObjectName indicates the complete path of the object, in which the folder (if any) and the suffix of the object are also included.