- Documentation
Torch Object Storage
User Guide
Data processing
Basic concepts
Saving processed files
Basic concepts
Saving processed files
Saving processed files
TOS does not save processed images or video frames by default. However, you can add persistence parameters to the processing URL to save these files to a designated bucket. This topic outlines the relevant parameters for saving processed images and video frames and provides examples of how to use them.
Notes
- To save a processed image or video frame, your account must have read permissions for the bucket that contains the original image or video, and write permissions for the bucket that will store the processed image or video frame.
- Anonymous users must specify a bucket with public write access for saving processed images and video frames.
- The source and target buckets must be in the same region.
- The default access permission for processed images and video frames is "Private", and the default storage type is "Standard Storage".
- By default, processed images and video frames use the server-side encryption method of the bucket to which they are saved. If the target bucket uses SSE-KMS, ensure your account has permission for the bucket's Key Management Service (KMS) key.
Supported parameters
Examples
There are two methods you can use to save a processed image.
- Generate a presigned URL that includes image processing and persistence parameters, and use it to save the processed image.
- Add persistence parameters to the URL for accessing and processing the image, and then save the processed image to the specified bucket. Note that this method uses anonymous access and requires the target bucket to have public write access. Otherwise, the save operation will fail.
warning
The URLs below demonstrate how to add persistence parameters. However, since you do not have write permissions for the example bucket, accessing these URLs will result in an Access Denied message.
Processed image URL: https://tos-tools.tos-cn-beijing.volces.com/misc/sample.png?x-tos-process=image/resize,w_100
- Save the processed image as "abc.png" in the same bucket as the original image:
- https://tos-tools.tos-cn-beijing.volces.com/misc/sample.png?x-tos-process=image/resize,w_100&x-tos-save-object=YWJjLnBuZw==
- Save the processed image as "abc.png" in a bucket named "arctic":
- https://tos-tools.tos-cn-beijing.volces.com/misc/sample.png?x-tos-process=image/resize,w_100&x-tos-save-object=YWJjLnBuZw==&x-tos-save-bucket=YXJjdGlj
Saving a video frame
Video frame URL: https://tos-tools.tos-cn-beijing.volces.com/misc%2Fvideo.mp4?x-tos-process=video/snapshot,t_26000,w_400,h_200,f_jpg
- Save the video frame as "abc.jpg" in the same bucket as the original image:
- https://tos-tools.tos-cn-beijing.volces.com/misc%2Fvideo.mp4?x-tos-process=video/snapshot,t_26000,w_400,h_200,f_jpg&x-tos-save-object=YWJjLnBuZw==
- Save the video frame as "abc.jpg" in a bucket named "arctic":
- https://tos-tools.tos-cn-beijing.volces.com/misc%2Fvideo.mp4?x-tos-process=video/snapshot,t_26000,w_400,h_200,f_jpg&x-tos-save-object=YWJjLnBuZw==&x-tos-save-bucket=YXJjdGlj
Last updated: 2026.10.13 10:20:02