Upload callback

Last Updated: May 17, 2017

When an upload is complete, OSS can perform a callback to the application server. To perform callback, users simply need to attach the relevant Callback parameter to the request sent to OSS. APIs that currently support callback include PutObject, PostObject, and CompleteMultipartUpload.

Note: Currently, upload callback is supported only for Mainland China data centers, and only simple uploads (PutObject), form uploads (PostObject), and multipart uploads completion (CompleteMultipartUpload) support upload callback.

Applicable scenarios

A typical upload callback scenario is when authorized third-party users upload files to the OSS, the clients specify the servers for callback. Then after the upload is complete, the OSS automatically initiates a callback request to the application server over HTTP. This notifies the application server that the upload is complete, so it can perform operations such as database modification. Upon receiving a response from the server, the OSS returns the status to the client.

When the OSS sends a POST callback request to the application server, the POST request’s body contains parameters that provide certain information. The parameters are divided into two types:

  • System-defined parameters
    This parameter specifies simple information such as bucket name and object name.
  • User-defined parameters
    This parameter specifies information based on the application logic determined when sending a request, including callback to the OSS, and carries details such as the user ID of the request initiator. For information on user-defined parameters, refer to Callback.

The application of the upload callback mechanism can decrease the complexity of the client’s logic and reduce the consumption of network resources. The process is as follows:

Reference

Best practices

Thank you! We've received your feedback.