Generates a signed URL for accessing OSS objects.
Command syntax
ossutil presign oss://bucket[/prefix] [flags]
|
Parameter |
Type |
Description |
|
-d, --dirs |
/ |
Lists objects and subdirectories in the current directory instead of recursing into subdirectories. |
|
--encoding-type |
string |
Encoding for object or file names. Valid value: url. |
|
--end-with |
string |
Returns objects whose names alphabetically precede or match the specified value. |
|
--exclude |
stringArray |
Exclusion rule for paths or object names. |
|
--exclude-from |
stringArray |
Reads exclusion rules from a file. |
|
--expires-date |
Time |
Expiration time of the signed URL. |
|
--expires-duration |
Duration |
Validity period of the signed URL. Range: 1 second to 1 week. Default: 15m0s. |
|
--files-from |
stringArray |
Reads source object names from a file. Empty and comment lines are ignored. |
|
--files-from-raw |
stringArray |
Reads source object names from a file. |
|
--filter |
stringArray |
Filter rule for paths or object names. |
|
--filter-from |
stringArray |
Reads filter rules from a file. |
|
-f, --force |
/ |
Forces the operation without confirmation. |
|
--include |
stringArray |
Inclusion rule for paths or object names. |
|
--include-from |
stringArray |
Reads inclusion rules from a file. |
|
--limited-num |
int |
Maximum number of results to return. |
|
--list-objects |
/ |
Lists objects using the ListObjects operation. |
|
--min-age |
Duration |
Processes only files modified before the specified time interval. Default unit: seconds. Supports unit suffixes such as 1h for one hour. Note
|
|
--max-age |
Duration |
Processes only files modified within the specified time interval. Default unit: seconds. Supports unit suffixes such as 1h for one hour. Note
|
|
--min-mtime |
Time |
Processes only files modified after the specified time. Format: UTC, for example, 2006-01-02T15:04:05. Note
|
|
--max-mtime |
Time |
Processes only files modified before the specified time. Format: UTC, for example, 2006-01-02T15:04:05. |
|
--max-size |
SizeSuffix |
Maximum transferable file size. Default unit: bytes (B). Supports 1024-based units: B, K, M, G, T, P. |
|
--metadata-exclude |
stringArray |
Exclusion rule for object metadata. |
|
--metadata-filter |
stringArray |
Filter rule for object metadata. |
|
--metadata-filter-from |
stringArray |
Reads metadata filter rules from a file. |
|
--metadata-include |
stringArray |
Inclusion rule for object metadata. |
|
--min-size |
SizeSuffix |
Minimum transferable file size. Default unit: bytes (B). Supports 1024-based units: B, K, M, G, T, P. |
|
--page-size |
int |
Maximum objects listed per page during batch processing. Default: 1000. Valid values: 1 to 1000. |
|
--query-param |
stringArray |
The query parameters in the request. |
|
-r, --recursive |
/ |
Performs the operation recursively on all matching objects in the bucket. Without this flag, only objects in the specified path are affected. |
|
--request-payer |
string |
Request payer. Set to requester if pay-by-requester is enabled on the bucket. |
|
--start-after |
string |
Returns objects whose names alphabetically precede or match the --end-with value. |
|
--traffic-limit |
int |
Bandwidth limit per connection. Valid values: 819200 to 838860800. |
|
--version-id |
string |
Version ID of the object. |
For more information, see Command-line options.
Examples
-
Generate a signed URL for example.txt in examplebucket with the default 15-minute validity period.
ossutil presign oss://examplebucket/example.txt -
Generate a signed URL for example.txt in examplebucket with a 1-hour validity period.
ossutil presign oss://examplebucket/example.txt --expires-duration 1h -
Generate a signed URL for example.txt in examplebucket that remains valid until 2024-06-01T12:00:00 (UTC).
ossutil presign oss://examplebucket/example.txt --expires-date 2024-06-01T12:00:00 -
Generate a signed URL for example.txt in examplebucket with image processing parameters.
ossutil presign oss://examplebucket/example.txt --query-param x-oss-process=image/resize,m_fixed,w_100,h_100/rotate,90 -
Generate a signed URL for version "123" of example.txt in examplebucket.
ossutil presign oss://examplebucket/example.txt --version-id 123 -
Generate signed URLs for all objects in examplebucket/folder/ with the default 15-minute validity period.
ossutil presign oss://examplebucket/folder/ -r -
Generate signed URLs for .txt files in examplebucket/folder/ with the default 15-minute validity period.
ossutil presign oss://examplebucket/folder/ -r --include "*.txt"