Closed aceben81 closed 1 year ago
I don't see anything wrong with the two test cases you've provided, except in the second case you're not using the stream backpressure mechanism (e.g. when stream.write()
returns false
and starts buffering more data in memory).
Have you tried removing third party modules (e.g. http-proxy-middleware
) to ensure they are not causing the problem you're having?
I didn't test except http-proxy-middleware
.
I will try to test only using express
and busboy
.
Thank you for your answer.
I coded it as shown in the example, and I was very satisfied. Save the file in the middle when sending another server based on http-proxy-middleware.
There is no problem when receiving files as streams at once. However, there are duplicate and invalid content when receiving and saving files when cutting and sending files from a client multiple times.
There seems to be a problem when writing again after writing all the data that came in.
}
var restream = function(proxyReq, req, res, options) { const bb = busboy({ headers: req.headers }); bb.on('file', (name, file, info) => {
}