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

Sharing a Folder

Scenarios

You can share your folders in OBS to other users.

Background Information

Folder sharing is temporary and has a validity period. You can temporarily share folders by access code or URL:

  • By access code: Specify a six-digit access code before creating a sharing task. After the sharing task is created, OBS aggregates the download links of all objects in the folder to a static website that is hosted by a public OBS bucket. Then anyone who has the created temporary URL and access code can access the static website and download the shared files.
  • By URL: Specify a validity period and then share the generated link with others. Anyone can use a signature to access all objects in the shared folder.

Constraints

  • A folder shared from OBS Console can be valid for one minute to 18 hours. If you need a longer validity period, use OBS Browser+ that allows a validity period of up to one year to share the folder. If you want a shared folder permanently valid, use a bucket policy to grant anonymous users the public read permission for the folder.
  • Folder sharing is available for a few regions only.
  • Only version 3.0 buckets support folder sharing. You can view the bucket version in the Basic Information area on the Overview page of a bucket.
  • Archive objects in a folder must be restored in the bucket before they can be downloaded.
  • Deep Archive objects in a folder must be restored in the bucket before they can be downloaded.

Procedure

  1. In the navigation pane of OBS Console, choose Object Storage.
  2. In the bucket list, click the bucket you want to operate 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 1 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

      A validity period is 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 access code is required to access objects in the 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 the shared URL in a web browser.
        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 2 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

      A validity period is 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 Link and share the link with another user. The user then can use this link 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 3.
    4. Verify that a user can use the sharing link to access all objects in the folder.
      1. Open a browser.
      2. Enter the sharing link 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 3 Accessing an object with a sharing link