Updated on 2024-10-24 GMT+08:00

Upload Overview

Scenarios

You can upload files or folders to an existing OBS bucket. If you want to classify files, you can create folders and upload files to different folders.

For details about how to create a folder, see Creating a Folder.

These files can be texts, images, videos, or any other type of files.

OBS allows you to upload objects to buckets in a specified region but is not aware of any content of your objects. If your object uploads involve cross-border transfer, ensure that your use complies with relevant laws and regulations.

Notes and Constraints

Size and number of objects to upload

  • OBS Console puts limits on the size and number of files you can upload.
    • In regions that support batch uploads, a maximum of 100 files can be uploaded at a time, with a total size of no more than 5 GB. If you upload only one file in a batch, this file cannot exceed 5 GB.
    • In regions that do not support batch uploads, only one file can be uploaded at a time, with a size of no more than 50 MB.
  • With OBS Browser+ or obsutil, you can upload files smaller than 48.8 TB. OBS Browser+ allows you to upload up to 500 files at a time. There is no limit on the number of files you can upload using obsutil at a time.
  • With PUT, POST, or append methods of the OBS SDKs or API, you can upload files smaller than 5 GB.
  • With multipart uploads of the OBS SDKs or API or resumable uploads of the OBS SDKs, you can upload files smaller than 48.8 TB.
  • You can specify a quota for a bucket to limit its space usage. For details, see Managing Bucket Quotas.

Object naming

See Guidelines on Naming Object Keys.

Batch operations

Batch uploads are available only when:
  1. The bucket is in any of the following regions: CN-Hong Kong, AP-Bangkok, or AP-Singapore.
  2. The bucket version is 3.0. To view the bucket version, see Checking OBS Version (OBS 2.0 or OBS 3.0).

Folder uploads

You can upload folders using OBS Console, OBS Browser+, or obsutil.

Others

  • Versioning is not enabled for a bucket:
    • If you upload a new file with the same name as the one in the bucket, the new file will automatically overwrite the previous one and the ACL information of the previous file will not be retained.
    • If you upload a new folder with the same name as the one 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.
  • If versioning is enabled for your bucket and you upload a new file with the same name as the one you previously uploaded to the bucket, a new file version will be added to the bucket. For details, see Versioning.

Object Types

Object Type

Description

Notes

Normal

Objects that are uploaded using Streaming Upload (PUT) or Browser-based Upload (Post)

If versioning is not enabled or is suspended, a newly uploaded object overwrites the previous one with the same name and only the object uploaded by the last API call is retained.

If versioning is enabled, each operation on an object will create a new version of the object. The version generated by the most recent operation is the latest one.

Multipart

Objects that are uploaded using Multipart Upload

If versioning is not enabled or is suspended, the complete object that is assembled later overwrites the previous one with the same name and only the complete object assembled by the last API call is retained.

If versioning is enabled, each operation on an assembled object will create a new version of the object. The version generated by the most recent operation is the latest one.

Appendable

Objects that are uploaded using Appendable Upload

You can directly append data to such objects.

Upload Methods

Upload Method

Description

Streaming upload (PUT)

Use PUT or POST if the size of the file to be uploaded is less than 5 GB.

If you use PUT, you need to specify the object name in the URL, but object name is not required with POST, which uses the bucket domain name as the URL. Request lines of these two methods are given as follows:

PUT /ObjectName HTTP/1.1
POST / HTTP/1.1

Browser-based upload (POST)

Multipart upload

Use this method when the size of the file to be uploaded is greater than 5 GB and less than 48.8 TB.

For details, see Multipart Upload.

NOTE:

If you have over 48.8 TB data to upload, refer to Migrating Local Data to OBS.

Resumable upload

Uploading large files often fails due to poor network conditions or program breakdowns. Re-uploads not only waste lost of resources, but may also fail again. To avoid such issues, you can use the resumable upload API, which works by dividing a to-be-uploaded file into multiple parts and then uploading them separately. This API helps save resources and improves efficiency by allowing for resumption from the break point and concurrent uploads.

For details, see Does OBS Support Resumable Data Transfer?

Incremental synchronization

This function synchronizes incremental content in a local source directory to the specified target bucket in OBS to ensure consistency. It works by comparing the source files in a local directory with their counterparts in the corresponding bucket in OBS and uploading only those with content changes, so all source files can remain identical to those uploaded to OBS.

For details, see Synchronously Uploading Incremental Objects.

Append upload

This method adds data to the end of an object in a specified bucket. If there is no object with the same key found in the bucket, a new object is created.

For details, see Appendable Upload.

Temporary upload authorization

If a third-party user does not have the upload permission, they can be granted temporary access to upload objects within a validity period.

For details, see Authorizing a Third Party to Upload Objects.

Ways to Upload

You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to upload an object.