# deleteFile

Deletes files from cloud storage. Up to 50 files can be deleted at a time.

Request parameters

Field Description Data Type Default Required
fileList Array of cloud file ID strings String[] - Y

Promise return parameter

Field Description Data Type
fileList List of deleted files. Each object in the list is defined below Object[]

Objects in fileList are described as follows

Field Description Data Type
fileID Cloud file ID String
status Status code. 0 means success Number
errMsg ok means success; displays cause of failure if fails String

Error return parameter

Field Description Data Type
errCode Error code Number
errMsg Error message, in the format of apiName:fail msg String

# Use Case

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
}
点击咨询小助手