After you upload objects to a bucket, you can share the URLs of the objects with third parties for downloads or previews. This topic describes how to share an object in the Object Storage Service (OSS) console.

Prerequisites

Objects are uploaded to the bucket. For more information, see Upload objects.

Procedure

  1. Log on to the OSS console.
  2. In the left-side navigation pane, click Buckets. On the Buckets page, click the name of the desired bucket.
  3. In the left-side navigation pane, click Files. Then, click the name of the object that you want to share, or click View Details in the Actions column.
  4. In the View Details panel, click Copy.
    If the access control list (ACL) of the object that you want to share is private, you must configure Validity Period (Seconds) during which the URL is valid. The default validity period of a URL is 3,600 seconds (1 hour). The maximum validity period is 32,400 seconds (9 hours). To obtain a URL with a longer validity period, we recommend that you use ossutil, ossbrowser, or OSS SDKs.
    • Preview an object by using the object URL

      To ensure that the object is previewed but not downloaded when third parties use the object URL that you share to access the object, you must map a custom domain name to your bucket and add a CNAME record. For more information, see Use custom domain names to access OSS resources.

    • Download an object by using the object URL

      To ensure that the object is downloaded when third parties use the object URL that you share to access the object, you must set the Content-Disposition field in the HTTP headers of the object to attachment. For more information, see Configure object metadata.