Uploading an Object
Scenarios
You can upload files or folders to an existing OBS bucket. If you want to classify files to be uploaded, create a folder and upload related files to the folder.
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 Huawei Cloud does not detect the object content you uploaded. If your object uploads involve cross-border transfer, ensure that your use complies with relevant laws and regulations.
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 size.
- 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 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.
- 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 the bucket's capacity for storing the uploaded objects. For details, see Managing Bucket Quotas.
Object naming
Batch operations
Folder uploads
- You can upload folders using OBS Console, OBS Browser+, or obsutil.
Others
- If versioning is disabled and the name of a newly uploaded file is the same as that of a file in the bucket, the newly uploaded file automatically overwrites the existing file and does not retain the ACL information of the existing file. If the name of the newly uploaded folder is the same as that of a folder in the bucket, the two folders will be merged, and files in the new folder will overwrite namesake files in the old folder.
- If versioning is enabled and the name of a newly uploaded file is the same as that of a file in the bucket, a new version is added to the existing file. For details about versioning, see Versioning.
Upload Methods
Upload Method |
Description |
---|---|
PUT (Streaming upload) |
Use the PUT or POST method when the size of the file to be uploaded is less than 5 GB. For details about the differences between the two upload methods, see What Are the Differences Between PUT and POST Upload Methods? |
POST (browser-based upload) |
|
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 Uploading Objects Using a Multipart Upload. |
Resumable transfer |
Uploading large files often fails due to poor network conditions or program breakdowns. It is a waste of resources to restart the upload process upon an upload failure, and the restarted upload process may still suffer from the unstable network. To resolve such issues, you can use the API for resumable upload, whose working principle is to divide the to-be-uploaded file into multiple parts and upload them separately. This method saves resources and improves efficiency upon the re-upload, and speeds up the upload process by concurrently uploading parts. For details, see Does OBS Support Resumable Data Transfer? |
Synchronous upload of incremental objects |
This method synchronizes all content in the local source path to the specified target bucket in OBS, ensuring that the content is consistent between the local path and the target bucket. Incremental synchronization has the following meanings: 1) Increment: Compare the source file with the target object and upload only the source file that has changes. 2) Synchronization: After the command is executed, ensure that the local source path is a subset of the target bucket specified by OBS. That is, any file in the local source path has its corresponding object in the target bucket on OBS. |
Appendable upload |
The AppendObject operation adds data to the end of an object in a specified bucket. If there is no namesake object in the bucket, a new object is created. For details, see Appending an Object. |
Related Operations
When uploading an object, you can specify a storage class for it. After the object is uploaded, you can also change its storage class.
- You can manually change objects among the Standard, Infrequent Access, Archive storage classes. Objects in the Archive storage class must be restored before they can be manually changed to the Standard, or Infrequent Access storage class. Changing the storage class of objects in the Infrequent Access or Archive storage class involves retrieval costs, so you are advised to change their storage classes based on the access frequency and scenario.
- The minimum storage duration is 90 days for Archive storage, and 30 days for Infrequent Access storage. If an object is transitioned to another storage class before it has been stored for the required minimum storage duration, you need to pay for the remaining days.
- You can also configure a lifecycle rule to transition the storage class of an object. For details, see Lifecycle Management.
Causes of Object Upload Failures and Solutions
For details, see Why Am I Unable to Upload an Object?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.