Element el-upload 读取如何读取txt文件内容

Element el-upload 读取如何读取txt文件内容

已解决 悬赏分:60 - 解决时间 2021-11-27 07:34
反对 0举报 0 收藏 0

回答2

最佳
  • @
    function printFile(file) {
      var reader = new FileReader();
      reader.onload = function(evt) {
        console.log(evt.target.result);
      };
      reader.readAsText(file);
    }

    可以参考fileReader 这个api

    支持 0 反对 0 举报
    2021-11-26 09:23
  • @

    https://www.runoob.com/java/java-filereader.html

    支持 0 反对 0 举报
    2021-11-26 09:49