In this sample, you can learn how to connect Object Storage Service (OSS) with Function Compute by using OSS triggers. It assumes that you have signed up for Function Compute and OSS.
In some cases, you may not want to call functions directly. For example, an application may have used Object Storage Service (OSS) to store images that you have uploaded. In this case, you can use a function to download and process the images and store the processing results in OSS or other services. If OSS can detect incremental images and automatically call the corresponding function, you do not need to call the function manually. The development and application processes are simplified.
After you create an OSS trigger for a function, the relevant OSS event triggers the function.
In this example, a file prefixed with
source/ and stored in the specified OSS bucket can call the resize function automatically. This function scales the image and stores the processing result in the
processed/ directory of the same bucket. For example, the function processes