Updated on 2024-02-05 GMT+08:00

Uploading an Object

This section describes how to upload local files to OBS over the Internet. These files can be texts, images, videos, or any other type of files.

Limitations and Constraints

OBS Console has restrictions on the size and number of files uploaded.

  • In regions where batch upload is supported, a maximum of 100 files can be uploaded at a time, with a maximum total size of 5 GB.
  • In regions where batch upload is not supported, only one file can be uploaded at a time, with a maximum size of 50 MB.

Therefore, for a single file to be uploaded, its maximum size can be 5 GB in a batch upload or 50 MB in a single upload.

To upload a file larger than 5 GB, but no larger than 48.8 TB, you can use OBS Browser+ or obsutil, or the multipart upload of OBS SDKs or APIs.

OBS Browser+ allows you to upload a maximum of 500 files at a time. There is no limit on the number of files you can upload using obsutil at a time.

If you have more data to upload, refer to Migrating Local Data to OBS.

Batch upload is available only when both of the following conditions are met:

  1. The region where the bucket is located supports batch upload.
  2. The bucket version is 3.0. To view the bucket version, see Viewing Basic Information of a Bucket.

If versioning is disabled for your bucket and you upload a new file with the same name as the one you previously uploaded to your bucket, the new file automatically overwrites the previous one and does not retain its ACL information. If you upload a new folder using the same name that was used with a previous folder in the bucket, the two folders will be merged, and files in the new folder will overwrite those with the same name in the previous folder.

After versioning is enabled for your bucket, if the new file you upload has the same name as the one you previously uploaded to the bucket, a new file version will be added in the bucket. For details, see Versioning.

Prerequisites

  • At least one bucket has been created.
  • If you want to classify files, you can create folders and upload files to different folders. For details, see Creating a Folder.

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. Go to the folder where you want to upload files and click Upload Object. The Upload Object dialog box is displayed.

    Batch upload is used as an example here. If the region you are using supports only single upload, perform operations as instructed.

    If the files that you want to upload to OBS are stored in Microsoft OneDrive, it is recommended that the names of these files contain a maximum of 32 characters to ensure compatibility.

    Figure 1 Uploading objects

  4. Select a storage class. If you do not specify a storage class, the objects you upload inherit the default storage class of the bucket.

    An object can have a different storage class from its bucket. You can specify a storage class for an object when uploading it, or you can change the object storage class after the object is uploaded.

  5. In the Upload Object area, drag and drop the files or folders you want to upload.

    You can also click add files in the Upload Object area to select files.

  6. Server-Side Encryption: Choose Disable, SSE-KMS, or SSE-OBS. For details, see Uploading an Object in Server-Side Encryption Mode.

    If a bucket has server-side encryption configured, you can select Inherit from bucket when uploading an object to the bucket, for the object to inherit the encryption settings from the bucket.

  7. (Optional) To configure metadata or WORM retention policies, click Next: (Optional) Configure Advanced Settings.

    WORM retention policies can be configured in the advanced settings only when WORM is enabled for the bucket.

    Configuring metadata: Add metadata ContentDisposition, ContentLanguage, WebsiteRedirectLocation, ContentEncoding, or ContentType as needed. For more information, see OBS Object Metadata. Metadata is a set of name-value pairs. The metadata value cannot be left blank. You can add two or more metadata entries by clicking Add.

    Configuring WORM retention: Choose Inherit from bucket, or choose Configure and then specify a retention period, to automatically protect new objects uploaded to the bucket from being deleted.

    Figure 2 Configuring metadata or WORM retention

  8. Click Upload.