PutObject

Interface description

Upload the file (object) to the specified bucket.

Request Syntax

PUT GatewayURL

Request Header

KeyTypeDescriptionSample value

BucketName

character string

The specified bucket name

samplebucket

cipher

character string

The key used to encrypt the file

sampleencryptkey

Don't forget to add your identity signature to the header.

Requestor

KeyContent-TypeDescriptionSample value

file

multipart/form-data

Specify the documents to be submitted

test.log

Response

Response format: application/json

Status codeMessageResponse description

200

fid

Operation successful, return the file fid

400

InvalidHead.MissingToken

The access key is empty, or the permissions are insufficient

400

InvalidHead.MissingBucketName

The bucket name is missing or not entered

400

InvalidHead.BucketName

Wrong bucket name

400

InvalidHead.Token

Access key error

400

Invalid.DuplicateFileName

Duplicate file

400

Unauthorized

Space is not authorized

400

InvalidParameter.EmptyFile

An empty file uploaded

400

InvalidParameter.FormFile

A form file uploaded

400

InvalidParameter.File

Receive file error

403

NoPermission

Access key verification failed

500

InternalError

Server internal error

Request example

Request to upload the file of test.log

# curl -X PUT URL/ -F 'file=@test.log;type=application/octet-stream' -H "Account: cX..." -H "Message: xxx" -H "Signature: 0x..." -H "BucketName: bucket1"

Last updated