3***@qq.com
3***@qq.com
  • 发布:2020-06-21 12:56
  • 更新:2020-06-21 12:56
  • 阅读:1787

删除文件

分类:uni-app

uni.removeSavedFile(OBJECT);

删除本地存储的文件。

1 平台

App H5 微信小程序 支付宝小程序 百度小程序 字节跳动小程序 QQ小程序
x

2 语法

语法:

2.1 OBJECT参数

参数名 类型 必填 说明 平台差异
filePath String 需要删除的文件路径
success Function 接口调用成功的回调函数
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

3 示例

uni.getSavedFileList({  
  success: function (res) {  
    if (res.fileList.length > 0) {  
      uni.removeSavedFile({  
        filePath: res.fileList[0].filePath,  
        complete: function (res) {  
          console.log(res);  
        }  
      });  
    }  
  }  
});
0 关注 分享

要回复文章请先登录注册