codecamp

QQ小程序 deleteFile

Cloud.deleteFile(fileList: string[]): Promise<Object>

从云存储空间删除文件,一次最多 50 个

参数

fileList: string[] 云文件 ID 字符串数组

返回值

Promise.<Object>

属性 类型 说明
fileList Object 文件列表

fileList 的结构

属性 类型 说明
fileID string 云文件 ID
status number 状态码,0 为成功
errMsg string 成功为 ok,失败为失败原因

示例

const cloud = require('qq-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
}
QQ小程序 downloadFile
QQ小程序 getQQContext
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

QQ小程序 开发

硬件能力

QQ小程序 云开发

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }