wx.removeSavedFile-删除本地存储的文件

wx.removeSavedFile(OBJECT)

删除本地存储的文件


OBJECT参数说明:

参数类型必填说明
filePathString需要删除的文件路径
successFunction接口调用成功的回调函数
failFunction接口调用失败的回调函数
completeFunction接口调用结束的回调函数(调用成功、失败都会执行)


示例代码:

wx.getSavedFileList({
    success: function (res) {
        if (res.fileList.length > 0) {
            wx.removeSavedFile({
                    filePath: res.fileList[0].filePath,
                    complete: function (res) {
                    console.log('========')
                    console.log(res)
                }
            })
        }
    }
})