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

  • If the bucket ACL is public read or public read/write, the format of the URL is: BucketName.Endpoint/ObjectName.
    For example, if the myphoto.jpg object is in the abc folder of the aliyun-abc bucket in the China (Hangzhou) region, the URL is as follows:
    • URL for access over the Internet: aliyun-abc.oss-cn-hangzhou.aliyuncs.com/abc/myphoto.jpg.
    • URL for access over the internal network (from ECS instances that are located in the same region as the object): aliyun-abc.oss-cn-hangzhou-internal.aliyuncs.com/abc/myphoto.jpg.
    Note
    • For more information about region endpoints, see Regions and endpoints.
    • ObjectName is the complete path of the object, in which the folder (if any) and the suffix of the object is also included.
  • If the bucket ACL is private, you must sign the URL. The signed URL must be in the following format: BucketName.Endpoint/Object?SignatureParameters. You can obtain the URL of an object in any of the following ways.
  • If the bucket to which the object belongs is bound to a custom domain name, the URL format of the object is YourDomainName/ObjectName.
    For example, if the myphoto.jpg object is in the abc folder of the aliyun-abc bucket in the China (Hangzhou) region and you have a domain name img.123.com:
    • If you do not bind the custom domain name to the bucket, the object URL is aliyun-abc.oss-cn-hangzhou.aliyuncs.com/abc/myphoto.jpg.
    • If you have bound the custom domain name to the bucket, the object URL is img.123.com/abc/myphoto.jpg.
    Note ObjectName is the complete path of the object, in which the folder (if any) and the suffix of the object is also included.