小程序传两张图片到后台,总是显示找不到文件
发布于 7 年前 作者 ytang 3694 次浏览 来自 问答

var that=this

 

      // that.uplodePicture(data.UserFace,1);

     that.uplodePicture(data.UserFace, 1) .then(function (res) {

        if (res.statusCode == 200) {

      that.uplodePicture(data.useRopposite,2)

 

        }

      })

uplodePicture: function (options,n){

    console.log(options)

      console.log(this)

      var that=this;

      var data=that.data;

    var ordinaryId = ‘bc2dd6d’

    return new Promise(function (resolve, reject) {

       wx.uploadFile({

         url: url.uplodeP,

         filePath: options,

         name: ‘uploadFile’,

         formData: {

           n:n,

           ordinaryId: ordinaryId,

          umpireName: data.refreeName,

           umpirePhone: data.refreePhone,

           umpireINumber: data.refreeID,

           umpireRefereeAddress:data.address

           //umpireDate:data.dates

           },

         header: {

           “Content-Type”: “multipart/form-data”

         },

         success:function(res){

           console.log(res)

           console.log(res.data)

           if (res.statusCode == 200) {

             resolve(res);

             if(n<2){

               that.setData({

                 address: res.data

               })

             }else if(n==2){

               that.setData({

                 address: ‘’

               })

             }

 

           }

 

         },

       })

       })

  

  },

2 回复

能获取到图片名字,其他数据都可以获取到,但是imageIo找不到Tom act的临时文件

哥们,你上传图片,后台能获取到数据吗?

回到顶部