删除文件

removeSavedFile

解释:删除本地存储的文件

参数:Object

Object参数说明:

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

示例:

  1. swan.getSavedFileList({
    success: function (res) {
    if (res.fileList.length > 0){
    swan.removeSavedFile({
    filePath: res.fileList[0].filePath,
    success: function (res) {
    console.log(res.filePath);
    }
    });
    };
    }
    });

保存、获取文件打开新的文件页面