W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
支持端:小程序 , 云函數(shù) , Web
從云存儲(chǔ)空間刪除文件,一次最多 50 個(gè)
云文件 ID 字符串?dāng)?shù)組
屬性 | 類型 | 說明 |
---|---|---|
fileList | Object | 文件列表 |
fileList 的結(jié)構(gòu)
屬性 | 類型 | 說明 |
---|---|---|
fileID | string | 云文件 ID |
status | number | 狀態(tài)碼,0 為成功 |
errMsg | string | 成功為 ok,失敗為失敗原因 |
Promise 風(fēng)格
wx.cloud.deleteFile({
fileList: ['a7xzcb']
}).then(res => {
// handle success
console.log(res.fileList)
}).catch(error => {
// handle error
})
Callback 風(fēng)格
wx.cloud.deleteFile({
fileList: ['a7xzcb'],
success: res => {
// handle success
console.log(res.fileList)
},
fail: err => {
// handle error
},
complete: res => {
// ...
}
})
const cloud = require('wx-server-sdk')
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
})
exports.main = async (event, context) => {
const fileIDs = ['xxx', 'xxx']
const result = await cloud.deleteFile({
fileList: fileIDs,
})
return result.fileList
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: