-
API Reference
- Overview
- Initialization
- Pre-defined Constants
-
Bucket-Related APIs
- Before You Start
- HEAD Bucket
- DELETE Bucket
- GET Objects
- GET Object versions
- List Multipart uploads
- Obtain Bucket Metadata
- GET Bucket location
- GET Bucket storageinfo
- PUT Bucket quota
- GET Bucket quota
- Set Bucket storagePolicy
- GET Bucket storagePolicy
- PUT Bucket acl
- GET Bucket acl
- PUT Bucket logging
- GET Bucket logging
- PUT Bucket policy
- GET Bucket policy
- DELETE Bucket policy
- PUT Bucket lifecycle
- GET Bucket lifecycle
- DELETE Bucket lifecycle
- PUT Bucket website
- GET Bucket website
- DELETE Bucket website
- PUT Bucket versioning
- GET Bucket versioning
- GET Bucket cors
- DELETE Bucket cors
- PUT Bucket tagging
- GET Bucket tagging
- DELETE Bucket tagging
- Object-Related APIs
- Other APIs
- Change History
- General Reference
Copied.
Generating Browser-Based Upload Parameters with Authentication Information
API Description
You can use this API to generate parameters for authentication. The parameters can be used to upload data through POST operations based on a browser.
There are two request parameters generated:
- Policy, which corresponds to the policy field in the form
- Signature: which corresponds to the signature field in the form
Method Definition
ObsClient.createPostSignatureSync
Request Parameter
Field |
Type |
Optional or Mandatory |
Description |
---|---|---|---|
Bucket |
String |
Optional |
Bucket name |
Key |
String |
Optional |
Object name, which corresponds to the key field in the form |
Expires |
Number |
Optional |
Validity period of the browser-based upload authentication, in seconds. The default value is 300. |
FormParams |
Object |
Optional |
Other parameters of the browser-based upload except for key, policy, and signature. Possible values are:
|
Returned Result
Field |
Type |
Description |
---|---|---|
OriginPolicy |
String |
Value of Policy that is not encoded by base64. This parameter can only be used for verification. |
Policy |
String |
policy in the form |
Signature |
String |
signature in the form |
Sample Code
var formParams = {acl: 'public-read', 'content-type': 'text/plain'}; var res = obsClient.createPostSignatureSync({Bucket: 'bucketname', Key: 'objectkey', Expires:3600, FormParams: formParams}); console.log('Policy-->' + res['Policy']); console.log('Signature-->' + res['Signature']);
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot