wx.chooseMessageFile ,微信小程序上传文件word,excel

发布时间:2022-12-07 22:00

chooseMessageFile: function (e) {
    var that = this;
    wx.chooseMessageFile({
      count: 1,
      type: 'file',
      success(res) {
        var filename = res.tempFiles[0].name
        console.info(filename);
        that.setData({filename:filename});


        wx.uploadFile({
          url: app.globalData._server + "/test/object/upload",
          filePath: res.tempFiles[0].path,
          name: 'uploadFile',
          success(res) {
            //json字符串 需用JSON.parse 转
          }
        })



      }
    });
  }

 

ItVuer - 免责声明 - 关于我们 - 联系我们

本网站信息来源于互联网,如有侵权请联系:561261067@qq.com

桂ICP备16001015号