利用wx.uploadFile API 将图片上传至自己的服务器,结果报错:
uploadFile:fail unexpected end of stream
真机调试的结果如下:
[publib]:1 uploadFile:fail unexpected end of stream
Qe @ [publib]:1
(anonymous) @ [publib]:1
Bt.emit @ [publib]:1
ji @ [publib]:1
(anonymous) @ [publib]:1
(anonymous) @ [publib]:1
S @ [publib]:1
value @ [publib]:1208
(anonymous) @ [VM 44]:1
Script.runInContext @ vm.js:59
runInContext @ vm.js:120
handleEvaluateJavascript @ [publib]:588
handleProcessMessage @ [publib]:1233
ws.on @ [publib]:1458
emitOne @ events.js:115
emit @ events.js:210
_receiver.onmessage @ C:\Users\MAXGU\AppData\Roaming\Tencent\微信web开发者工具\package.nw\node_modules\ws\lib\WebSocket.js:146
dataMessage @ C:\Users\MAXGU\AppData\Roaming\Tencent\微信web开发者工具\package.nw\node_modules\ws\lib\Receiver.js:389
getData @ C:\Users\MAXGU\AppData\Roaming\Tencent\微信web开发者工具\package.nw\node_modules\ws\lib\Receiver.js:330
startLoop @ C:\Users\MAXGU\AppData\Roaming\Tencent\微信web开发者工具\package.nw\node_modules\ws\lib\Receiver.js:165
add @ C:\Users\MAXGU\AppData\Roaming\Tencent\微信web开发者工具\package.nw\node_modules\ws\lib\Receiver.js:139
_ultron.on @ C:\Users\MAXGU\AppData\Roaming\Tencent\微信web开发者工具\package.nw\node_modules\ws\lib\WebSocket.js:142
emitOne @ events.js:115
emit @ events.js:210
addChunk @ _stream_readable.js:263
readableAddChunk @ _stream_readable.js:250
Readable.push @ _stream_readable.js:208
onread @ net.js:595
服务器用Flask做的,服务器本身应该没问题,之前开发的另一款微信小程序,调用自己做的web api,一切正常,但这一次新开发的微信小程序调用同样的web api,结果出现上述问题
本文网址:http://www.91bianli.com/weixinxiaochengxu/24211.html