All Products
Search
Document Center

Object Storage Service:set-props (Set object properties)

Last Updated:Oct 01, 2025

The `set-props` command sets object properties, such as access permissions, storage class, metadata, and tags.

Command format

ossutil set-props oss://bucket[/prefix] [flags]

Parameter

Type

Description

--acl

string

The access permissions of the object. Valid values:

  • private: The object is private.

  • public-read: The object is public-read.

  • public-read-write: The object is public-read-write.

  • default: The object inherits the access permissions of the bucket.

--bigfile-threshold

int

The threshold to enable multipart upload, download, or copy for large files. The default value is 104857600.

--cache-control

string

Specifies the web page caching behavior when the object is downloaded.

--content-disposition

string

Specifies how the object is displayed.

--content-encoding

string

Specifies the encoding method of the object.

--content-type

string

The content type of the object.

-d, --dirs

/

Returns the files and subdirectories in the current directory. It does not recursively list all files in all subdirectories.

--encoding-type

string

The encoding method for the input object name or file name. Valid value: url.

--end-with

string

Sorts objects alphabetically and returns objects that are before or the same as the specified value.

--exclude

stringArray

The rules to exclude paths or file names.

--exclude-from

stringArray

Reads exclusion rules from a rule file.

--expires

string

Specifies the absolute expiration time for the cached content.

--files-from

stringArray

Reads a list of source file names from a file. Empty lines or comment lines are ignored.

--files-from-raw

stringArray

Reads a list of source file names from a file.

--filter

stringArray

The filtering rules for paths or file names.

--filter-from

stringArray

Reads filtering rules from a rule file.

-f, --force

/

Forces the operation without a confirmation prompt.

--include

stringArray

The rules to include paths or file names.

--include-from

stringArray

Reads inclusion rules from a rule file.

-j, --job

int

The number of concurrent tasks. The default value is 3.

Important

This parameter takes effect only when you specify the -f, --update, --size-only, or --ignore-existing parameter.

--list-objects

/

Uses the ListObjects API operation to list objects.

--max-size

SizeSuffix

The maximum size of a file to transfer. The default unit is byte. You can use suffixes such as B, K, M, G, T, or P. 1 K (KiB) = 1024 B.

--metadata

strings

Specifies the user metadata of the object. Use the key=value format.

Example: --metadata test=value,test1=value1.

--metadata-directive

string

The instruction to modify metadata. Valid values:

  • replace: Retains only the metadata specified in the command line options.

  • update: Takes the union of the metadata in the command line and the metadata of the object.

  • purge: Clears all metadata.

  • delete: Deletes the metadata specified in the command line options and retains the rest.

--metadata-exclude

stringArray

The rules to exclude object metadata.

--metadata-filter

stringArray

The filtering rules for object metadata.

--metadata-filter-from

stringArray

Reads object metadata filtering rules from a rule file.

--metadata-include

stringArray

The rules to include object metadata.

--min-age

Duration

Sets properties only for files modified before the specified time interval. The default unit is second. You can use a unit suffix. For example, 1h indicates 1 hour.

Note

--min-age 1h sets properties only for files modified 1 hour ago or earlier.

--max-age

Duration

Sets properties only for files modified within the specified time interval. The default unit is second. You can use a unit suffix. For example, 1h indicates 1 hour.

Note

--max-age 1h sets properties only for files modified within the last hour.

--min-mtime

Time

Sets properties only for files modified after a specified time. The time is in UTC. Example: 2006-01-02T15:04:05.

Note

--min-mtime "2006-01-02T15:04:05" sets properties only for files modified after 15:04:05 on January 2, 2006.

--max-mtime

Time

Sets properties only for files modified before a specified time. The time is in UTC. Example: 2006-01-02T15:04:05.

--min-size

SizeSuffix

The minimum size of a file to transfer. The default unit is byte. You can use suffixes such as B, K, M, G, T, or P. 1 K (KiB) = 1024 B.

--no-progress

/

Does not display the progress bar.

--page-size

int

The maximum number of objects to list per page for batch processing. The default value is 1000. The value ranges from 1 to 1000.

--parallel

int

The number of concurrent tasks for operations on a single file.

--part-size

SizeSuffix

The part size. By default, ossutil calculates an appropriate part size based on the file size. The value ranges from 100 KiB to 5 GiB.

-r, --recursive

/

Performs the operation recursively. If you specify this option, the command is applied to all matching objects in the bucket. Otherwise, the command is applied only to the object specified by the path.

--request-payer

string

The payment method for the request. If the pay-by-requester mode is enabled, set this parameter to `requester`.

--start-after

string

Sorts objects alphabetically and returns objects that are after the specified value.

--storage-class

string

The storage class of the object. Valid values:

  • Standard: Standard

  • IA: Infrequent Access

  • Archive: Archive Storage

  • ColdArchive: Cold Archive

  • DeepColdArchive: Deep Cold Archive

--tagging

strings

Specifies the tags of the object. Use the key=value format.

Example: --tagging tag1=value1,tag2=value2.

--tagging-directive

string

The instruction to modify tags. Valid values:

  • replace: Retains only the tags specified in the command line options.

  • update: Takes the union of the tags in the command line and the tags of the object.

  • purge: Clears all tags.

  • delete: Deletes the tags specified in the command line options and retains the rest.

--version-id

string

The version ID of the object.

--list-format

string

The format of the list file. Valid values: plain and inventory.

--list-manifest-from

string

Reads the description of the list file format from a file. This parameter is required when the list file format is `inventory`.

For more information, see Command-line options.

Usage examples

  • Set the access permissions of an object to private.

    ossutil set-props oss://examplebucket/exampleobject.txt --acl private
  • Set the storage class of an object to Archive Storage.

    ossutil set-props oss://examplebucket/exampleobject.txt --storage-class Archive
  • Change the `content-type` to `text/plain` for objects that end with `.txt`.

    ossutil set-props oss://bucket/prefix --content-type text/plain --include "*.txt" --metadata-directive update -r
  • Set tags for an object.

    ossutil set-props oss://examplebucket/exampleobject.txt --tagging tag1=value1 --tagging-directive update
  • Set object properties from a list.

    Note

    Each line in the list file represents an object and uses the OSS path format: `oss://{bucket}/{key}`. For example, the `list.txt` file contains:

    oss://examplebucket/key1 oss://examplebucket/key2
    ossutil set-props list://list.txt 
  • Set object properties from a manifest file.

    Note

    After you run an inventory task, a `csv.gz` file and a `manifest.json` file are generated in the inventory results. You need these two files to set object properties from a manifest file.

    ossutil set-props list://ca8007fc-4123-493e-9a01-dd1511fbac54.csv.gz --list-format inventory --list-manifest-from manifest.json