Updated on 2024-01-26 GMT+08:00

Temporarily Sharing Objects with All Accounts

Scenario

If you want to open an object to all users for a limited period of time, you can use the object sharing function.

Procedure for Sharing a File

  1. In the navigation pane of OBS Console, choose Object Storage.
  2. In the bucket list, click the bucket name you want to go to the Objects page.
  3. Locate the file to be shared and click Share in the Operation column. The Share File dialog box shown in Figure 1 is displayed.

    Once the Share File dialog box is opened, the URL is effective and valid for five minutes by default. If you change the validity period, the authentication information in the URL changes accordingly, and the URL's new validity period starts upon the change.

    Figure 1 Sharing a file

  4. Perform URL related operations.

    • Click Open URL to preview the file on a new page or directly download it to your default download path.
    • Click Copy Link to share the link to other users, so that they can enter the link to a web browser to access the file.
    • Click Copy Path to share the file path to users who have access permissions to the bucket. Then the users can search for the file by pasting the path to the search box of the bucket.

    Within the URL validity period, anyone who has the URL can access the file.

Procedure for Sharing a Folder

  1. In the navigation pane of OBS Console, choose Object Storage.
  2. In the bucket list, click the bucket name you want to go to the Objects page.
  3. Locate the folder you want to share and click Share in the Operation column. The Share Folder dialog box is displayed.
  4. Share the folder by access code or URL.
  5. Method 1: Share the folder by access code.

    Figure 2 Sharing by access code
    1. Choose Access code for Share By.
    2. Configure parameters.
      Table 1 Parameters for sharing a folder with an access code

      Parameter

      Description

      URL Validity Period

      The validity period is measured by minutes or hours, and ranges from one minute to 18 hours. The default value is five minutes.

      Within the URL validity period, anyone who has the URL can access the folder.

      Access Code

      A six-digit code.

      An extraction code is required to access a shared folder.

    3. Click Create Share to generate a sharing URL for the folder.
    4. Send the URL and access code to others for them to access the folder.
    5. Verify that other users can perform the following operations:
      1. Access the shared folder in a browser.
        1. Open a web browser, enter the shared URL, and open it.
        2. In the dialog box that is displayed, enter the access code and access objects in the shared folder.
      2. Access the shared folder on OBS Browser+.
        1. Start OBS Browser+.
        2. On the login page, click Authorization Code Login.
        3. Enter the authorization code and access code.
        4. Click Log In to access the shared folder.

  6. Method 2: Share the folder by URL.

    Figure 3 Sharing by URL
    1. Choose URL for Share By.
    2. Configure parameters.
      Table 2 Parameters for sharing a folder by URL

      Parameter

      Description

      URL Validity Period

      The validity period is measured by minutes or hours, and ranges from one minute to 18 hours. The default value is five minutes.

      Within the URL validity period, anyone who has the URL can access the folder.

    3. Click Copy URL and share the URL with another user. The user then can use this URL to access all objects in this folder. The sharing link consists of the bucket domain name (prefix) and signature information (suffix). Users can add an object path after the prefix of a sharing link to access or download the specified object in a folder, as shown in Figure 4.
    4. Verify that a user can use the sharing URL to access all objects in the folder.
      1. Open a browser.
      2. Enter the sharing URL in the address box and press Enter to list all objects in the folder.
      3. Copy the object path and paste it after the prefix.
      4. Press Enter. You can then access and download the specified object.
      Figure 4 Accessing an object with a sharing URL