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.
Implementation modes
Implementation mode | Description |
---|---|
Console | A user-friendly and intuitive web application |
ossbrowser | An easy-to-operate graphical tool |
ossutil | A high-performance command-line tool |
Java SDK | SDK demos for various programming languages |
Python SDK | |
PHP SDK | |
Go SDK | |
C SDK | |
.NET SDK | |
Android SDK | |
iOS SDK | |
Node.js SDK | |
Browser.js SDK | |
Ruby SDK |
Usage notes
- Limits on object size
You cannot upload objects larger than 5 GB. If objects you want to upload is larger than 5 GB, use resumable upload.
- Naming conventions
- The name can contain only UTF-8 characters.
- The name must be 1 to 1,023 bytes in length.
- Object names cannot start with a forward slash (/) or a backslash (\).
- Performance optimization
If you upload a large number of objects by using 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 by using sequential prefixes. For more information about how to change sequential prefixes to random prefixes, see OSS performance and scalability best practices.
- Prevent objects that have same names from being overwritten
By default, when you upload an object to OSS, the existing object that has the same object name is overwritten. You can use the following methods to prevent your objects from being unexpectedly overwritten:
- Enable versioning
If versioning is enabled, 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
FileAlreadyExists
error. If this parameter is excluded from the request header or the value of this parameter is false, the object with the same object name is overwritten. For more information, see PutObject.
- Enable versioning
Configure object metadata
When you use 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 objects are uploaded to OSS, you can use upload callback to submit a callback request to the specified application server and perform subsequent operations. For more information, see Upload callback.
- Images can be processed after they are uploaded. For more information, see IMG user guide.
- Audio or video objects can be processed after they are uploaded. For more information, see the "MPS" section in Cloud data processing.