Generating the Download Link of an Object
Function
You can use this command to generate the download link of a specified object in a bucket or generate the download links of objects in a bucket in batches by object name prefix.
Command Line Structure
- In Windows
- Generating the download link of a single object
obsutil sign obs://bucket/key [-e=300] [-config=xxx] [-endpoint=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
- Generating the download links of objects in batches by object name prefix
obsutil sign obs://bucket[/key] -r [-e=300] [-timeRange=time1-time2] [-include=*.xxx] [-exclude=*.xxx] [-o=xxx] [-config=xxx] [-endpoint=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
- Generating the download link of a single object
- In Linux or macOS
- Generating the download link of a single object
./obsutil sign obs://bucket/key [-e=300] [-config=xxx] [-endpoint=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
- Generating the download links of objects in batches by object name prefix
./obsutil sign obs://bucket[/key] -r [-e=300] [-timeRange=time1-time2] [-include=*.xxx] [-exclude=*.xxx] [-o=xxx] [-config=xxx] [-endpoint=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
- Generating the download link of a single object
Examples
- In Windows, run obsutil sign obs://bucket-test/test.txt to generate a single object download link:
obsutil sign obs://bucket-test/test.txt Download url of [obs://bucket-test/test.txt] is: http://your-endpoint/bucket-test/test.txt?AccessKeyId=xxxx&Expires=1552548758&Signature=xxxx
- In Windows, run obsutil sign obs://bucket-test/test/ -r to generate object download links in batches:
obsutil sign obs://bucket-test/test/ -r Generate download urls for objects . Generate the download url(s) for the objects in the bucket [bucket-test] finished Task id: af4dc692-6a88-4541-8156-ff1a889d2288
- If there are a large number of objects, obsutil saves the object download links to a specific file. The file name is associated with the task ID. For instance, the task ID in the example above is af4dc692-6a88-4541-8156-ff1a889d2288, so the file name should be sign_succeed_report_{timestamp}_af4dc692-6a88-4541-8156-ff1a889d2288.txt.
- By default, the file is stored under folder .obsutil_output in your user directory. You can also use parameter -o to specify a new folder.
Parameter Description
Parameter |
Optional or Mandatory |
Description |
---|---|---|
bucket |
Mandatory |
Bucket name |
key |
Optional |
Object name used for generating the download link of a single object, or object name prefix used for generating download links of objects in batches |
e |
Optional (additional parameter) |
Validity period of the generated download links of objects, in seconds. Minimum value: 60s. Default value: 300s |
r |
Mandatory when generating download links of objects in batches (additional parameter) |
Generates the download links of objects in batches by a specified object name prefix. |
exclude |
Optional when generating download links of objects in batches (additional parameter) |
Indicates the matching patterns of objects that are excluded, for example: *.txt.
NOTE:
NOTICE:
|
include |
Optional when generating download links of objects in batches (additional parameter) |
Indicates the matching patterns of objects that are included, for example: *.jpg.
NOTE:
NOTICE:
|
timeRange |
Optional (additional parameter) |
Indicates the time range matching pattern when generating download links of objects. Only the download links of objects whose latest modification time is within the configured time range are generated. This pattern has a lower priority than the object matching patterns (exclude/include). That is, the time range matching pattern is executed after the configured object matching patterns.
NOTE:
|
o |
Optional when generating download links of objects in batches (additional parameter) |
Indicates the folder where operation result lists reside. After the command is executed, result lists (possibly including success and failure files) are generated in the folder. The default value is .obsutil_output, the subfolder in the home directory of the user who executes obsutil commands.
NOTE:
|
config |
Optional (additional parameter) |
User-defined configuration file for executing a command. For details about parameters that can be configured, see Parameter Description. |
endpoint |
Optional (additional parameter) |
Specifies the endpoint. |
i |
Optional (additional parameter) |
Specifies the user's AK. |
k |
Optional (additional parameter) |
Specifies the user's SK. |
t |
Optional (additional parameter) |
Specifies the user's security token. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.