For simple upload, you can call the PutObject operation to upload single objects. You can use simple upload in scenarios where you want to upload an object smaller than 5 GB by sending one HTTP request.
|Console||A user-friendly and intuitive web application|
|ossbrowser||Easy-to-operate graphical tool|
|ossutil||A high-performance command-line tool|
|Java SDK||SDK demos for various programming languages|
- You cannot upload objects larger than 5 GB.
- Object names must comply with the following naming conventions:
- Object names must be encoded in UTF-8.
- Object names must be one byte to 1,023 bytes in length.
- Object names cannot start with a forward slash (/) or a backslash (\).
- If you upload a large number of objects with sequential prefixes such as timestamps and letters in the object names, multiple object indexes may be stored in a single partition. If too many requests are sent to query these objects, the responsiveness may be slow. We recommend that you do not upload a large number of objects with sequential prefixes. For more information about how to change sequential prefixes to random prefixes, see OSS performance and scalability best practices.
- By default, when you upload an object to OSS, the existing object with the same object
name will be overwritten. You can use the following methods to protect your objects
from being unexpectedly overwritten:
- Enable versioning
If versioning is enabled, deleted or overwritten objects are saved as previous versions. You can recover the previous versions at any time. For more information, see Overview.
- Include a parameter in the upload request header
Include the x-oss-forbid-overwrite parameter in the upload request header, and set its value to true. This way, when you upload an object whose object name is the same as that of an existing object, the object cannot be uploaded. OSS returns the
FileAlreadyExistserror. For more information, see PutObject.
If this parameter is not included in the request header or the value of this parameter is false, the object with the same object name is overwritten.
- Enable versioning
Configure object metadata
When using simple upload, you can configure object metadata to describe an object. For example, you can set standard HTTP headers such as Content-Type. You can also set user-defined metadata. For more information, see Manage object metadata.
Security and authorization
To prevent unauthorized third-party users from uploading data to your bucket, OSS provides bucket- and object-level access control. For more information, see Overview.
To authorize third-party users to upload objects, OSS also provides account-based authorization. For more information, see Authorized third-party upload.
What to do next
- After uploading objects to OSS, you can use Upload callback to submit a callback request to the specified application server and perform subsequent operations.
- Images can be processed after they are uploaded. For more information, see Image processing.
- Audio or video objects can be processed after they are uploaded. For more information, see the "Media Processing" section in Cloud data processing.