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
Test
RAM authorization
|
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:
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:
|
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.