All Products
Search
Document Center

:append-object

Last Updated:Sep 26, 2024

Uploads an object by appending the object to an existing object.

Usage notes

  • By default, an Alibaba Cloud account has the permissions to configure and query objects. To configure and query objects by using a RAM user or Security Token Service (STS), you must have the oss:PutObject and oss:GetObject permissions. For more information, see Attach a custom policy to a RAM user.

  • The maximum size of an object that is generated by running the append-object command is 5 GB.

  • You cannot encrypt appendable objects by using SSE-KMS with a specific customer master key (CMK) ID.

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 the object is downloaded.

--content-encoding

string

The method that you want to use to encode the object.

--content-md5

string

The MD5 hash calculated by using the MD5 algorithm. This parameter is used to check whether the content of the received message is the same as that of the sent message.

--expires

string

The time when the request expires.

--key

string

The full path of the object.

--metadata

stringArray

The metadata of the object. To specify custom metadata, you must specify parameters prefixed with x-oss-meta-*.

--object-acl

string

The access control list (ACL) of the object.

--position

string

The position from which you want to append the object.

--server-side-encryption

string

The method that is used to encrypt the object.

--storage-class

string

The storage class of the object.

--tagging

string

The tag that you want to specify for the object by using a key-value pair. You can specify multiple tags for an object. Example: TagA=A&TagB=B.

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

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

Examples

  • Append an object to the exampleobject object by uploading a string.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss"
  • Append an object to the exampleobject object by uploading a file.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body file://appendFile
  • Append an object to the exampleobject object by uploading a string and specify the object metadata.

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

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --tagging "TagA=A&TagB=B"
  • Append an object to the exampleobject object by uploading a string and specify the object ACL and storage class.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --object-acl private --storage-class IA
  • Append an object to the exampleobject object by uploading a string and specify the method that you want to use to encrypt the object.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --body "hi oss" --server-side-encryption AES256
  • Append an object to the exampleobject object by uploading a string and specify the caching behavior of the web page when the object is downloaded.

    ossutil api append-object --bucket examplebucket --key exampleobject --position 0 --body "hi oss" --cache-control no-cache
  • Append an object to the exampleobject object by uploading a string and specify the name of the object when the object is downloaded.

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

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