All Products
Search
Document Center

Cloud Backup:CreateTempFileUploadUrl

Last Updated:Dec 17, 2024

Generates the parameters and signature required for a file upload URL.

Operation description

  1. You can directly upload a file to Object Storage Service (OSS) by using a form based on the returned value of this operation.
  2. For more information about how to upload a file to OSS by using a form, see OSS documentation.
  3. The system periodically deletes files that are uploaded to OSS.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
hbr:CreateTempFileUploadUrl
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
FileNamestringYes

The name of the file to be uploaded.

file-list.txt

Response parameters

ParameterTypeDescriptionExample
object
Endpointstring

The endpoint that is used to upload the file to OSS.

oss-cn-shenzhen.aliyuncs.com
RequestIdstring

The ID of the request.

F4EEB401-DD21-588D-AE3B-1E835C7655E1
ExpireTimelong

The expiration time of the signature that is used to upload the file to OSS. This value is a UNIX timestamp. Unit: seconds.

1654326678
Successboolean

Indicates whether the call is successful. Valid values:

  • true: The call is successful.
  • false: The call fails.
true
Codestring

The HTTP status code. The status code 200 indicates that the call is successful.

200
TempFileKeystring

The key that is used to upload the file to OSS.

temp/1440155109798732/upload/2022-07-29/49bed34c-b430-4e7e-89b1-4be2b734f95c/iaclone.diff
Messagestring

The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.

successful
BucketNamestring

The name of the OSS bucket to which the file is uploaded.

hbr-temp-bucket
OssAccessKeyIdstring

The AccessKey ID that is used to upload the file to OSS.

LTAI****Up
Policystring

The policy that is used to upload the file to OSS.

eyJleH****V19
Signaturestring

The signature that is used to upload the file to OSS.

RmhI****0A=

Examples

Sample success responses

JSONformat

{
  "Endpoint": "oss-cn-shenzhen.aliyuncs.com",
  "RequestId": "F4EEB401-DD21-588D-AE3B-1E835C7655E1",
  "ExpireTime": 1654326678,
  "Success": true,
  "Code": "200",
  "TempFileKey": "temp/1440155109798732/upload/2022-07-29/49bed34c-b430-4e7e-89b1-4be2b734f95c/iaclone.diff",
  "Message": "successful",
  "BucketName": "hbr-temp-bucket",
  "OssAccessKeyId": "LTAI****Up",
  "Policy": "eyJleH****V19",
  "Signature": "RmhI****0A="
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history