我是一nodejs新手,老板要求我能用nodejs实现stream方式上传图片,google良久,发现formidable很好用,也很受人们喜爱,然后在google找到许多例子,但是总是实现不了
var form = new formidable.IncomingForm();
form.parse( request, function( error, fields, files ) {
console.log( "Completed Parsing" );
if( error ){
response.writeHead( 500, { "Content-Type" : "text/plain" } );
response.end( "CRAP! " + error + "\n" );
return;
}
}
在这里的时候 总是报错 Error: MultipartParser.end(): stream ended unexpectedly: state = START,在github上有相关问题的讨论,研究良久仍不得其解,望各位帮忙,谢谢。