The Object Storage Service (OSS) console is a user-friendly web tool from Alibaba Cloud for managing OSS resources. This tutorial shows you how to perform basic operations like creating a bucket, uploading an object, and sharing an object in under 10 minutes, with an estimated cost of less than CNY 0.01.
Prerequisites
-
Completed individual identity verification or enterprise identity verification.
-
Activated Object Storage Service.
Purchasing an OSS resource plan does not automatically activate Object Storage Service. You must activate the service manually. Activation is free.
Step 1: Create a bucket
A bucket is a container for storing objects. To use Object Storage Service, you must first create a bucket.
-
In the left navigation pane, go to Buckets and click Create Bucket.
-
Configure the following parameters and leave the others at their default values:
-
Bucket Name: Enter a globally unique name. To ensure uniqueness, we recommend using a combination of project name-region-random string, such as
my-project-hangzhou-a1b2c3d4. -
Region: Select the region closest to you to reduce access latency, such as China (Hangzhou).
-
-
Click Create.
Step 2: Upload an object
After creating a bucket, you can upload various types of objects, such as images, videos, and documents.
The console supports uploading objects up to 5 GB at a time. For larger objects, we recommend using the command-line tool ossutil.
-
If you do not have a test object on your local machine, download the sample object exampleobject.jpg.
-
On the Buckets page, click the name of the bucket that you just created.
-
In the left navigation pane, choose Object Management > Objects, then click Upload Object.
-
Drag the exampleobject.jpg object from your local machine to the Files to Upload area, or click Select Files to choose the object.
-
Leave the other parameters at their default settings and click Upload Object.
You can view the upload progress of each object on the Upload Tasks tab. After the upload is complete, you can view the object name, size, storage class, and other information in the destination path.
Step 3: Download an object
You can download objects from a bucket to your local machine.
-
On the Objects page, find the exampleobject.jpg object that you uploaded.
-
Select the checkbox next to the object and click Download.
Step 4: Share an object
For objects in a private bucket, you can generate a signed URL with a limited validity period to share them.
-
On the Objects page, click the object name
exampleobject.jpg. -
In the View Details panel, set the Validity Period (Seconds) for the URL (the default is 600), and then click Copy Object URL.
-
Billing: This URL uses a public endpoint. Any download through this URL incurs outbound internet traffic fees.
-
Security: Before you share the URL, make sure the object does not contain any sensitive data.
-
Validity: The URL automatically expires after the specified period. To access the object again, you must generate a new URL.
-
-
Paste the copied URL into your browser's address bar to access the object. By default, the browser downloads the object. To preview the object in the browser instead of downloading it, you need to bind a custom domain name and use the custom domain name to generate the URL.
Step 5: Clean up resources
To prevent ongoing charges, first delete all objects from the bucket, and then delete the bucket. This operation cannot be undone.
Delete objects
-
In the left navigation pane, choose Object Management>Objects.
-
Select the checkbox for the sample object exampleobject.jpg that you uploaded.
-
Click Permanently Delete, and then click OK.
Delete the bucket
After deleting a bucket, you must wait several hours (typically 4 to 8 hours) before you can create another one with the same name.
-
On the Buckets page, click the name of the bucket that you want to delete.
-
In the left navigation pane, click Delete Bucket.
-
Click Delete Immediately and follow the on-screen instructions to complete the deletion.
Billing
This tutorial involves the following billable items in Object Storage Service:
-
Storage fees: Standard storage fees accrue while objects remain stored.
-
Outbound internet traffic fees: When others download an object by using the shared URL, outbound internet traffic fees apply.
-
Request fees: Upload and download operations incur API request fees.
The total cost for completing this tutorial, which involves uploading an object smaller than 1 MB and downloading it once, is estimated to be less than CNY 0.01. For more information about pricing, see OSS Pricing.
Next steps
-
Manage costs: Learn more about billing details in the Billing overview and save costs by using resource plans.
-
Automate operations: Use the SDK quick start to programmatically manage Object Storage Service in your applications.
-
Perform more object operations: View the feature guide to learn more ways of managing objects.
-
Strengthen data security: Learn how to manage data access permissions at a fine-grained level from the overview of permissions and access control.
NoteBlock public access is enabled by default when you create buckets by using the OSS console. Once Block Public Access is enabled, you cannot configure public access permissions, including public ACLs (public read and public read/write) and bucket policies that allows public access. You can disable this feature after the bucket is created if your business requires public access.