May 20, 2021 WeChat Mini Program Development Document
Delete files from cloud storage
Request parameters
Field | Description | The data type | The default | Required |
---|---|---|---|---|
fileList | An array of cloud file ID strings | String[] | - | Y |
Promise returns parameters
Field | Description | The data type |
---|---|---|
fileList | Delete the results list, and the definition of each object in the list is in the table below | Object[] |
Description of the objects in the fileList list
Field | Description | The data type |
---|---|---|
fileID | Cloud file ID | String |
status | Status code, 0 is successful | Number |
errMsg | Success is ok and failure is the cause of failure | String |
The argument was returned incorrectly
Field | Description | The data type |
---|---|---|
errCode | Error code | Number |
errMsg | Error message, format apiName:fail msg | String |
const cloud = require('wx-server-sdk')
exports.main = async (event, context) => {
const fileIDs = ['xxx', 'xxx']
const result = await cloud.deleteFile({
fileList: fileIDs,
})
return result.fileList
}