Closed caaatisgood closed 7 years ago
Hi,
Sure you can just pipe()
files to whatever stream you wish. The reason files are ReadStreams
and not FileStreams
is because async-busboy is caching files to disk.
So you can just:
files.map(file => {
file.pipe(fs.createWriteStream('output.txt'))
}
Hi,
So apparently, I've got typo in my code. Thanks for your reply! Now everything works well.
You mentioned that async-busboy is chaching files to disk. Is it because you want to make sure that the files in the request can be read with no error occurs?
Ok good, closing this issue then. We write the files to disk so that we can "buffer" them and make them available all at once.
Got it, thanks a ton.
Hi,
After the server receive the formdata and have been successfully parsed by async-busboy you built. I need to save the file to some other directory. How can I make it?
The reason why I didn't use co-busboy is that it act like a middleware. But I expect the saving operations can be processed in a specific route.
Here's the co-busboy example:
What I expect:
(By printing out the
file
variable in the map function above and thepart
variable in the while loop. I notice thatfile
is kind of like a ReadStream object whilepart
is a FileStream object. )Sorry about asking a question that is not fully related to your repo. I've tried some other parser and methods but it seems like it still cannot work properly. Could you give me some advice about how to solve this problem?
Much appreciated