All Products
Search
Document Center

Security Center:CreateFileDetectUploadUrl

Last Updated:Aug 28, 2026

Obtains the parameters required to upload a file for detection.

Operation description

Call this operation to obtain the upload parameters for a file detection task. If the response parameter FileExist is true, the file already exists in the cloud and you can directly submit it for detection. If FileExist is false, use the form upload method to upload the file to the specified Object Storage Service (OSS) bucket based on the response parameters.

The form upload method is provided by OSS. For more information, see Form upload.

All file detection API operations include the HashKey parameter, which specifies the unique identifier of a file. Only MD5 hash values are supported. Calculate the MD5 hash value of the file before you call this operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-sas:CreateFileDetectUploadUrl

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

HashKeyList

array

No

The identifiers of files. Only MD5 hash values are supported.

Note

You must specify at least one of the HashKeyList and HashKeyContextList parameters.

CreateFileDetectUploadUrl

string

No

The identifier of the file. Only MD5 hash values are supported.

0a212417e65c26ff133cfff28f6c****

Type

integer

Yes

The type of the file. Valid values:

  • 0: unknown file

  • 1: binary file

  • 2: webshell file

  • 4: script file

Note

If you do not know the type of the file, set this parameter to 0.

0

HashKeyContextList

array<object>

No

The hash values of files.

Note

You must specify at least one of the HashKeyList and HashKeyContextList parameters.

object

No

HashKey

string

No

The hash value of the file.

30319dd5cee8f894766e479cac170da0

FileSize

integer

No

The size of the file. Unit: bytes.

2698557

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID, which is used to locate and troubleshoot issues.

09969D2C-4FAD-429E-BFBF-9A60DEF8BF6F

UploadUrlList

array<object>

The upload parameters for each file.

array<object>

PublicUrl

string

The public URL for uploading the file.

http://example.com

InternalUrl

string

The internal URL for uploading the file.

http://example.com

Expire

string

The expiration time of the upload parameters. Unit: milliseconds.

1658562101370

Context

object

The signature information.

AccessId

string

The AccessKey ID used to access the OSS bucket.

yourAccessKeyID

Policy

string

The upload policy that specifies constraints such as file size limits.

eyJleHBpcmF0aW9uIjoiMjAyMi0wNy0yM1QxMDo1ODoxMC****

Signature

string

The signature used to upload the file.

wDhPgVdnY/bkKFYcYFl+4crl****

OssKey

string

The object key assigned to the file in the OSS bucket after upload.

1/2022/06/23/15/41/16559701077444693a0c6-33b2-4cc2-a99f-9f38b8b8****

FileExist

boolean

Indicates whether the file exists in the cloud. Valid values:

  • true: The file exists in the cloud. You do not need to upload the file.

  • false: The file does not exist in the cloud. You must upload the file.

false

HashKey

string

The identifier of the file.

0a212417e65c26ff133cfff28f6c****

Code

string

The status code. A value of 200 indicates success. Other values indicate failure.

200

Message

string

The error message returned.

successful

Examples

Success response

JSON format

{
  "RequestId": "09969D2C-4FAD-429E-BFBF-9A60DEF8BF6F",
  "UploadUrlList": [
    {
      "PublicUrl": "http://example.com",
      "InternalUrl": "http://example.com",
      "Expire": "1658562101370",
      "Context": {
        "AccessId": "yourAccessKeyID",
        "Policy": "eyJleHBpcmF0aW9uIjoiMjAyMi0wNy0yM1QxMDo1ODoxMC****",
        "Signature": "wDhPgVdnY/bkKFYcYFl+4crl****",
        "OssKey": "1/2022/06/23/15/41/16559701077444693a0c6-33b2-4cc2-a99f-9f38b8b8****"
      },
      "FileExist": false,
      "HashKey": "0a212417e65c26ff133cfff28f6c****",
      "Code": "200",
      "Message": "successful"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 RequestTooFrequently Request too frequently, please try again later
400 InvalidApiDetectType Unsupported Api Detect Type. The file type is not supported.
500 ServerError ServerError
500 SystemBusy System busy, please try again later.
403 NoPermission caller has no permission You are not authorized to do this operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.