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 |
The bucket name |
key |
Optional |
The 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) |
The 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) |
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) |
The matching patterns of objects that are included, for example: *.jpg
NOTE:
NOTICE:
|
timeRange |
Optional (additional parameter) |
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) |
The folder that stores the result files. After the command is executed, result files (possibly success and failure files) will be created in the specified folder. The default value is .obsutil_output, a subfolder in the user's home directory where obsutil commands are executed.
NOTE:
|
config |
Optional (additional parameter) |
The user-defined configuration file for executing the current command. To learn the parameters that can be configured in this file, see Configuration Parameters. |
endpoint |
Optional (additional parameter) |
The endpoint |
i |
Optional (additional parameter) |
The user's AK |
k |
Optional (additional parameter) |
The user's SK |
t |
Optional (additional parameter) |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot