You can specify the x-oss-process field to execute a processing task in synchronous mode. In this mode, an application cannot proceed to execute another task until the current task is completed. Synchronous processing is suitable for tasks of which results are returned in an efficient manner, such as image processing and document processing.
Operations that support synchronous processing
You must replace the asterisk (*) in the operation name described in the following table with the actual data processing parameter. For example, you can specify x-oss-process=image/resize
to resize images.
Feature | Operation | References | Methods |
Image processing | x-oss-process=image/* |
| |
Document processing | x-oss-process=doc/* |
| |
Media processing |
| ||
Image intelligence ( except decoding blind watermarks) | x-oss-process=image/* |
FAQ
Can I perform multiple operations simultaneously in synchronous mode?
When you execute a synchronous processing task in which anonymous access is allowed, such as an image processing task, you can add multiple processing parameters to the URL to perform operations simultaneously.
You can resize the image and add watermarks by using the following URL .
https://examplebucket.oss-cn-hangzhou.aliyuncs.com/example.jpg?x-oss-process=image/resize,w_300,h_300/watermark,image_cGFuZGEucG5n,t_90
When you execute a synchronous processing task in which anonymous access is not allowed, such as a document processing task, you can use Object Storage Service (OSS) SDKs and add multiple processing parameters to perform operations simultaneously.
The following code provides an example of how to convert the format and capture a snapshot of a document by adding parameters and using OSS SDK for Java.
getObjectRequest.setProcess("doc/convert,target_jpg,source_docx/snapshot,target_jpg,source_docx,page_2");
Reference
For more information about how to save processed files in OSS, see Save As.