All Products
Search
Document Center

Object Storage Service:append-object

Last Updated:Dec 06, 2025

The append-object command appends data to an object.

Usage notes

  • The final object created using the append-object command cannot exceed 5 GB.

  • The append-object command does not support server-side encryption with Key Management Service (KMS) using a specified customer master key (CMK) ID.

Permissions

By default, an Alibaba Cloud account has full permissions. RAM users or RAM roles under an Alibaba Cloud account do not have any permissions by default. The Alibaba Cloud account or account administrator must grant operation permissions through RAM Policy or Bucket policies.

API

Action

Definition

AppendObject

oss:PutObject

You can call this operation to upload an object by appending the object to an existing object.

oss:PutObjectTagging

When uploading an object by appending the object to an existing object, if you specify object tags through x-oss-tagging, this permission is required.

Command syntax

ossutil api append-object --bucket value --key value --position value [flags]

Parameter

Type

Description

--body

string

The request body.

--bucket

string

The name of the bucket.

--cache-control

string

The web page caching behavior of the object.

--content-disposition

string

The name of the object when it is downloaded.

--content-encoding

string

The encoding format of the object content.

--content-md5

string

The MD5 hash of the object content. This request header is used to check whether the message content is the same as the content that was sent.

--expires

string

The expiration time.

--key

string

The full path of the object.

--metadata

stringArray

The metadata of the object. To specify custom metadata, configure parameters that are prefixed with x-oss-meta-*.

--object-acl

string

The access control list (ACL) of the object.

--position

string

The position from which to start appending data.

--server-side-encryption

string

The server-side encryption method.

--storage-class

string

The storage class of the object.

--tagging

string

The tags of the object. You can specify multiple tags. Example: TagA=A&TagB=B.

Note
  • The append-object command corresponds to the AppendObject API operation. For more information about the parameters of the API operation, see AppendObject.

  • For more information about supported global command-line options, see Global command-line options.

Examples

  • Append data from a string to the object named exampleobject.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss"
  • Append data from a file to the object named exampleobject.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body file://appendFile
  • Append data from a string to the object named exampleobject and include custom metadata.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --metadata user=aliyun --metadata email=ali***@aliyuncs.com
  • Append data from a string to the object named exampleobject and specify object tags.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --tagging "TagA=A&TagB=B"
  • Append data from a string to the object named exampleobject and specify the access control list (ACL) and storage class of the object.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --object-acl private --storage-class IA
  • Append data from a string to the object named exampleobject and specify the server-side encryption method.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --body "hi oss" --server-side-encryption AES256
  • Append data from a string and specify the web page caching behavior for the object when it is downloaded.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --cache-control no-cache
  • Append data from a string and specify the filename of the object when it is downloaded.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --content-disposition "attachment;filename=oss_download.jpg"
  • Append data from a string to the object named exampleobject and specify the Content-MD5 hash of the object.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --content-md5 ohhnqLBJFiKkPSBO1eNaUA==