Console quick start

更新时间:
复制 MD 格式

This tutorial describes how to use the OSS console to create a bucket, upload, download, and share an object, and then delete the object and bucket.

Prerequisites

Object Storage Service (OSS) is activated.

Note

Activating OSS is free of charge. Purchasing an OSS resource plan does not automatically activate OSS. The service must still be activated manually.

The operations in this tutorial may incur storage, API request, and outbound Internet traffic fees. Actual fees depend on the object size, storage duration, and outbound Internet traffic. For more information, see Billing overview and OSS pricing.

Create a bucket

A bucket is a container in which objects are stored. After a bucket is created, objects can be uploaded to and managed in the bucket.

  1. Go to the Buckets page and click Create Bucket.

  2. Configure the following parameters and retain the default settings for the other parameters.

    Parameter

    Example value

    Description

    Bucket Name

    my-project-hangzhou-a1b2c3d4

    Enter a globally unique name.

    Region

    China (Hangzhou)

    Select a region close to the service users to reduce access latency. The region cannot be changed after the bucket is created. For more information, see Regions and endpoints.

  3. Click Create and confirm that the bucket is created.

  4. Click Go to Bucket to go to the bucket that you created.

Object operations

In OSS, a file is stored as an object. An object is the basic unit of data stored in a bucket. Follow these steps to upload, download, and share an object.

Upload an object

Upload a local file to the bucket created in the preceding section.

Note

You can upload an object of up to 5 GB at a time in the console. To upload a larger object, we recommend that you use ossutil.

  1. Click Upload Object.

  2. Click Select Files and select a local file.

  3. Click Upload Object and wait for the upload to complete.

After the upload is complete, the object list displays the object name, size, storage class, and other information.

Download an object

  1. On the Objects page, click the name of the object that you uploaded or View Details.

  2. Click Download to save the object to your local computer.

Share an object

You can share an object in a private bucket by using a signed URL that has a validity period.

  1. On the Objects page, click the name of the object that you uploaded or View Details.

  2. Configure the validity period as needed and click Copy Object URL.

  3. Send the copied URL to the users who need to access the object. By default, a browser downloads the object. To preview an image or web page in a browser, first map a custom domain name to the bucket and then use the custom domain name to generate the URL.

Important

A signed URL automatically expires after the configured validity period. Before sharing the URL, make sure that the object does not contain sensitive data. Downloading the object over the Internet by using the URL incurs outbound Internet traffic fees.

Clean up resources

If the resources created in this tutorial are no longer needed, delete the object before deleting the bucket. Deleted resources cannot be recovered.

Delete the object

  1. On the Objects page, select the object that you uploaded.

  2. Click Permanently Delete and follow the on-screen instructions to confirm the operation.

Delete the bucket

Note

After you delete a bucket, you must wait several hours, typically four to eight hours, before you can create another bucket that has the same name.

  1. In the bucket menu bar, click Delete Bucket.

  2. Make sure that Mandatory Item is complete and click Delete Immediately.

  3. Enter the bucket name and click OK.