您现在的位置:首页 >> 前端 >> 内容

ionic3中cordova-plugin-filechooser选择中文文件名乱码问题解决

时间:2018/2/1 15:29:04 点击:

  核心提示:ionic3中,利用cordova-plugin-filechooser插件可以进行文件选择,如果选择的文件名是中文,返回的uri会出现乱码解决方法decodeURI()this.fileChoose...

ionic3中,利用cordova-plugin-filechooser插件可以进行文件选择,如果选择的文件名是中文,返回的uri会出现乱码

解决方法

decodeURI()
this.fileChooser.open()
    .then(uri => {
      console.log(uri);
      this.filePath=decodeURI(uri);
      return this.filePath;
    })
    .catch(e => {
        console.log(e)
        return "";
    });

Tags:IO ON NI IC 
作者:网络 来源:qingdatian