[英]node.js - How does Busboy actually work?
I'm a bit confused with Busboy module. 我对Busboy模块有点困惑。 I don't understand where it takes file data to stream as it accepts only request headers as parameter?!
我不明白文件数据流向何处,因为它仅接受请求标头作为参数? Take a look on example from docs:
看一下文档中的示例:
var busboy = new Busboy({ headers: req.headers });
busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {
//...
// btw file is ReadableStream!
});
它通过管道将请求主体传递给它,请参见示例 :
req.pipe(busboy);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.