小程序图片上传,后端使用的是wafer2-server SDK,只是修改了cos的配置,使用的是本地调试。
小程序开发工具返回错误信息:
上传成功 //上传失败了还是调用了success函数很奇怪
nolocal.vue:26 {"code":-1,"error":"ENOENT: no such file or directory, open 'F:\\tmp\\3Fdz4SlaDProAhsWPDaft7ly.png'"}
下边是上传代码
upload(){ let that = this wx.chooseImage({ success(res) { console.log(that) const tempFilePaths = res.tempFilePaths that.imgUrl = tempFilePaths[0] console.log(that.imgUrl) console.log(tempFilePaths[0]) wx.uploadFile({ url: config.uploderUrl, // 仅为示例,非真实的接口地址 filePath: tempFilePaths[0], name: 'file' , success(res) { console.log( '上传成功' ) const data = res.data console.log(res.data) // do something }, fail(res) { consile.log( '--->' ,res) |
时候正常情况下table按键可以自动补全html中的标签,
下边是koa后端捕获错误
koa-weapp-demo Catch Error: { Error: ENOENT: no such file or directory, open 'F:\tmp\3Fdz4SlaDProAhsWPDaft7ly.png' errno: -4058, code: 'ENOENT', syscall: 'open', path: 'F:\\tmp\\3Fdz4SlaDProAhsWPDaft7ly.png' } +4m
后端代码用的什么框架啊,是spring boot 吗