- uni.removeSavedFile(OBJECT)
uni.removeSavedFile(OBJECT)
删除本地存储的文件。
平台差异说明
| 5+App | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 |
|---|---|---|---|---|---|
| √ | x | √ | √ | √ | √ |
OBJECT 参数说明:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| filePath | String | 是 | 需要删除的文件路径 |
| success | Function | 否 | 接口调用成功的回调函数 |
| fail | Function | 否 | 接口调用失败的回调函数 |
| complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
示例代码:
uni.getSavedFileList({success: function (res) {if (res.fileList.length > 0) {uni.removeSavedFile({filePath: res.fileList[0].filePath,complete: function (res) {console.log(res);}});}}});
