All Products
Search
Document Center

Object Storage Service:Upload objects using OSS SDK for Go

Last Updated:Dec 05, 2024

Object Storage service (OSS) SDK for Go provides a variety of methods to upload objects. You can choose the most suitable method based on your business requirements.

Method

Description

Simple upload

  • You can use simple upload to upload files, Blob data, or OSS buffers to OSS.

  • The size of the file to upload cannot exceed 5 GB.

Append upload

  • You can use append upload to append content to an appendable object.

  • The size of the file to append cannot exceed 5 GB.

Resumable upload

  • We recommend that you use resumable upload for the stable upload of large files.

  • Resumable upload records are stored in the checkpoint file. If an object fails to be uploaded due to a network exception or program error, the upload task is resumed from the position recorded in the checkpoint file to upload the remaining data.

  • The size of the file to upload cannot exceed 48.8 TB.

Multipart upload

  • We recommend that you use multipart upload to upload objects larger than 100 MB and smaller than 48.8 TB.

  • Multipart upload allows you to split a large object into multiple parts to upload. After these parts are uploaded, you can call the CompleteMultipartUpload operation to combine the parts into a complete object.

Upload callbacks

  • You can configure upload callback parameters to start a callback process for the application server after an object is uploaded.

  • You can perform specific operations after the file is uploaded, such as recording content in logs and subsequent processing tasks.