When the SDK is instantiated,
ForcePathStyle:true can be used to enable suffixed request, and then only the URL of the real request is needed, which is in the following format:
When a suffixed request is signed, the bucket name
/<bucketname-appid> will also be used in the signature calculation.
wx.downloadFileto download the image and get the temporary path.
wx.saveImageToPhotosAlbumto save the image to the album.
COS currently supports only WeChat mini programs, but WeChat mini programs do not interconnect with QQ mini programs. Therefore, the Mini Program SDK cannot be used.
getAuthorizationfunction do when mini programs use cos-wx-sdk-v5 to upload files to buckets?
The backend uses the
getAuthorization function in the Mini Program SDK to get a temporary key and sends it to the frontend for signature calculation. Then, you can perform operations such as upload and deletion on the files according to the signature calculation result. We recommend you use a temporary key to prevent disclosure of your key. For more information, see Getting Started.