Accessing an Object Using Its URL

OBS allows anonymous users to access object data using object URLs.

Prerequisites

A read permission has been set for anonymous users. For details about how to set the permission, see Permission for an Object.

Procedure

  1. Log in to OBS Console.
  2. In the bucket list, click the bucket where the object you want to share resides, to go to the Summary page.
  3. In the navigation tree on the left, click Object.

    NOTE:

    Encrypted objects cannot be shared.

  4. Click the object you want to share.
  5. The URL is displayed on the page, as shown in Figure 1. Anonymous users can access the object by clicking the URL. The object URL is in the format of https://bucket name.domain name/directory level/object name. If the object resides in the root directory of the bucket, its URL does not contain the directory level.

    Figure 1 Object link
    NOTE:
    • Objects in buckets whose storage class is OBS Archive are accessible to anonymous users through URLs only when they are in the Restored state.
    • If Versioning is enabled for a bucket and Show Version is enabled for the object list, the object URL contains a version ID and is in the format of https://bucket name.domain name/directory level/object name?versionId=version ID.
    • The method of using a browser to access objects varies depending on the object type. You can directly open .txt and .html files using a browser. However, when you open .exe and .dat files using a browser, the files are automatically downloaded to your local computer.

Troubleshooting

  • If an error message similar to the following is displayed when you are accessing an object using the object URL, configure the Read permission for Anonymous User. For details about how to set the permission, see Permission for an Object. After enabling the permission, perform the previous steps again.
    <Error> 
      <Code>AccessDenied</Code>  
      <Message>Access Denied</Message>  
      <RequestId>000173811E0000015B18BC86A3FBD65I</RequestId>  
      <HostId>bcmaSevE9j9tY/Mg646E5xkF5D2jTbHcmxXt6TEfICxLLgbauVuxjJ3hL8zfH+B2</HostId> 
    </Error>
  • If an error message similar to the following is displayed when you are accessing an object using the object URL, the object has been encrypted and an encrypted object cannot be accessed using the object URL.
    <Error> 
      <Code>InvalidArgument</Code>  
      <Message>Requests specifying Server Side Encryption with KMS managed keys require Signature Version 4.</Message>  
      <RequestId>000173811E0000015B18C601893BBEFQ</RequestId>  
      <HostId>B8OwldJm/6tRwVx1ONJ/ilTioZnndywWyWPgs3jF/zCyOARICV+dfn0XkXTh8vjW</HostId>  
      <ArgumentName>Authorization</ArgumentName>  
      <ArgumentValue>null</ArgumentValue> 
    </Error>
Registration