标签: javascript node.js request-headers node.js-stream busboy
我对Busboy模块感到困惑。我不明白文件数据流到哪里,因为它只接受请求标头作为参数?!看一下docs的例子:
var busboy = new Busboy({ headers: req.headers }); busboy.on('file', function (fieldname, file, filename, encoding, mimetype) { //... // btw file is ReadableStream! });
答案 0 :(得分:1)
它会将请求体传送给它,请参阅the example:
req.pipe(busboy);