ios手机如何删除调用wx.chooseVideo({})产生的临时文件?

发布于 6 年前作者 lchang2287 次浏览最后编辑 6 年前来自 ask

fm = wx.getFileSystemManager()

wx.chooseVideo({

      sourceType: ['album', 'camera'],

      maxDuration: 60,

      camera: 'back',

      compressed:false,

      success: function(res) {

var filePath = res.tempFilePath

        fm.unlink({

        filePath:filePath ,

        success:function(e){

          console.log('删除成功');

        },fail:function(e){

          console.log(e)

        }

      })


      },fail:function(e){

        console.log('选择视频失败');

      }

})

苹果手机删除文件提示无权限,安卓手机可以正常删除

1 回复
yang04
yang041 楼4 年前

调用FileSystemManager.saveFile以后再调用FileSystemManager.unlink删除具体参考此贴https://developers.weixin.qq.com/community/develop/doc/0006ccabe504605fb33b4c9235bc00