Uploading Pre-signed Authorized

Last Updated At: 2025-10-21 09:10:00

Applicable Scenario

By default, buckets and objects are private. If you want a third party to be able to upload objects to your bucket but do not want them to use a CAM account or temporary token, you can use a pre-signed URL to submit the signature to the third party to complete the temporary upload operation. Anyone who receives a valid pre-signed URL can upload an object.

When pre-signing a URL, you can set the object key to be included in the signature to only allow uploads to the specified path. You can also specify the HTTP request method to restrict specific object operations, such as upload, download, and delete. You can also specify the validity period of the pre-signed URL in the program to ensure that the URL will not be used by unauthorized parties after the timeout.

Usage Instructions

Using the REST API

You can directly use the REST API to initiate a request to get an object. See the GET Object documentation for details.

Using Java SDKs

COS supports AWS Java SDK. See Using AWS S3 SDK to Access COS to access COS, and operate according to the Generating Pre-signed URLs section in the official documentation of AWS Java SDK 2.20.0.