- wx.uploadFile调用怎么突然不行了?
直接上代码(关键是同样的代码,前天之前还一切正常) // 上传文件 wx.uploadFile({ url: app.globalData.g_conversionServer + 'uploadFile.php', // 此地址为保密做一点修饰 filePath: curFile.path, name: "file", formData: { openid: user._openid, fileName: curFile.name }, success: function (res) { console.log("pushFile.res=", res); // 此处的业务代码被我拿掉了 }, fail: function (err) { console.error("wx.uploadFile.err=", err); wx.showModal({ title: app.globalData.APP_MSG_TITLE, content: '有异常:' + err.errMsg + ',请稍等', confirmColor: app.globalData.CONFIRM_COLOR, showCancel: false, success: function (res) { if (res.confirm) { return; } } }) }, complete: res => { // 加载完成 // 后续处理代码被我拿掉了 } }); 选择文件后,出现长时间等待,最后的错误如下: errMsg: "uploadFile:fail upload fail:-101:net::ERR_CONNECTION_RESET" 令人不解的地方是: 1、开发环境中,上传正常(wx4a64fa8604591648)。但在真机和体验版本时异常。 2、我在另外的小程序(wxa563b23efa409007)中,采用几乎相同的处理逻辑,目前为止是正常的。 采用过的对策: 1、重启服务器,2、重启开发工具,3、切换到移动网络 最终结果还是没有正常,特急之贴!!!
2022-02-06 - 2022-08-15