All Products
Search
Document Center

Intelligent Media Management:TargetURI template

Last Updated:Apr 24, 2026

A TargetURI template dynamically generates a URI by replacing placeholders with actual values during processing. For example: oss://{bucket}/{tags.custom}/{dirname}/{barename}.{autoext}.

Syntax

  • Similar to the string format() method in Python 3, variables are enclosed in curly braces.

  • Variables include public variables and operator-specific variables. You can reference these built-in variables directly in the default namespace.

  • Variables can also be derived from the Tags parameter in a request. These variables are located in the tags namespace.

  • To output literal curly braces, escape them by doubling them, such as {{ for { and }} for }.

Public variables

Parameter

Description

Example

bucket

The name of the destination bucket.

test-bucket

key

The object key in the bucket. This is equivalent to {dirname}/{basename}.

path1/path2/name.png

dirname

The object path, without the filename.

path1/path2

barename

The original filename without the extension.

name

basename

The original filename with the extension.

name.png

ext

The file extension of the uploaded object. The extension is derived from the detected MIME type or the object key.

png

year

The year the object was uploaded, in yyyy format.

2022

mon

The month the object was uploaded, in mm format.

04

day

The day the object was uploaded, in dd format.

22

hour

The hour the object was uploaded, in HH format.

14

min

The minute the object was uploaded, in MM format.

38

sec

The second the object was uploaded, in SS format.

25

t_year

The year the task was created, in yyyy format.

2022

t_mon

The month the task was created, in mm format.

04

t_day

The day the task was created, in dd format.

22

t_hour

The hour the task was created, in HH format.

14

t_min

The minute the task was created, in MM format.

38

t_sec

The second the task was created, in SS format.

25

Operator-specific variables

The following variables are available for an office conversion task.

Parameter

Description

Example

index

The output index, starting from 1.

  • For Word, PDF, and PPT files, this is the page number.

  • For Excel files, the format is sheetindex_sheetsubindex.

    • sheetindex: The index of the sheet, starting from 1.

    • sheetsubindex: The page number within the specified sheet, starting from 1.

  • 1

  • 6_12

sheetname

For Excel files, this is the worksheet name.

sheet1

autoext

The file extension of the output object.

jpg

The following variables are available for a media transcoding task.

Parameter

Description

Example

streamindex

The audio or video stream ID. The IDs for audio and video streams increment separately, starting from 0. This variable applies to multi-output scenarios, such as frame capturing, sprite generation, animated image creation, and audio transcoding.

0

index

The output file index, starting from 1. This variable applies to multi-output scenarios, such as segmented transcoding and frame capturing.

1

resolution

The transcoding resolution, available only for video transcoding.

1920x1080

autoext

The file extension of the output object.

ts