Uploading Files

Last updated: 2020-03-12 16:46:02

    API Description

    Feature Description

    1. Upload media (and cover) files.
    2. For how to upload from a client using an API, please see Overview of Upload from Client.

    Via SDK

    It is recommended to use the encapsulated SDK to call the API.

    Via API

    For usage, please see the documents in the API links above. The syntax of each API is as follows:

    PUT <ObjectName> HTTP/1.1
    Host: <BucketName>-<APPID>.cos.<Region>.myqcloud.com
    Date: GMT Date
    Authorization: Auth String

    The following variables in the syntax take the values in the return result of the ApplyUpload API:

    • <ObjectName> is MediaStoragePath (or CoverStoragePath for a cover file).
    • <BucketName>-<APPID> is StorageBucket.
    • <Region> is StorageRegion.

    For API requests, note the following:

    • For the Authorization signature, use SecretId and SecretKey in TempCertificate in the return result of the ApplyUpload API. For the calculation method, please see Request Signature.
    • Pass in the x-cos-security-token field (identifying the security token used in the request) in the HTTP header or form-data of the POST request packet, and assign it the value of the Token field in TempCertificate.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help