ios手机如何删除调用wx.chooseVideo({})产生的临时文件?
发布于 5 年前 作者 lchang 2022 次浏览 来自 问答

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 回复

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

回到顶部