For simple upload, you can call the PutObject operation to upload a single object. You can use simple upload in scenarios where you want to upload an object smaller than 5 GB by sending an HTTP request.

Note For more information about PutObject, see PutObject.

Implementation methods

Implementation method Description
Console A user-friendly and intuitive web application
ossbrowser An easy-to use 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 the object size

    You cannot upload objects larger than 5 GB. If the object that you want to upload is larger than 5 GB, use resumable upload.

  • Naming conventions
    • The name must be encoded in UTF-8.
    • The name must be 1 to 1,023 characters in length.
    • The name cannot start with a forward slash (/) or backslash (\).
  • Optimize the performance of object upload

    If you use sequential prefixes such as timestamps or letters in the names of large numbers of objects, multiple object indexes may be stored in a single partition and responsiveness may significantly 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 the same name from being overwritten
    By default, when you upload an object to Object Storage Service (OSS), the existing object that has the same 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.

    • Add a specific header in the upload request

      Include the x-oss-forbid-overwrite parameter in the upload request header, and set the value to true. This way, when you upload an object whose name is the same as an existing object, the upload fails and OSS returns the FileAlreadyExists error. If this parameter is excluded in the request header or the value of this parameter is set to false, the object that has the same name is overwritten. For more information, see PutObject.

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 configure user 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 implementation modes.