Downloading a file using Node to a stream without first writing to a temporary file disk?

Is there a way to directly stream to a remote server or file archive when working with downloading Node.js files? I use the formidable one and I'm currently trying to include this script, but it always ends up writing a temporary file on my server first, which, in my opinion, is not necessary if the final destination is a remote server.

I also tried the connect-form, which is built on top of the formidable, but did not find any good documentation for onPart / handlePart, which I assume allows me to do this. Does anyone have a pointer to a good example that this scenario allows?

+5
source share
2 answers

It turns out that the Grozny team is working to make this script a lot easier with Node.js. When the problem is fixed, it will become much easier.

https://github.com/felixge/node-formidable/issues/61

+1
source

Not a stream, but you can get the contents of the line of the downloaded file (it will be saved in req.body.input_name) as follows:

app.use(express.bodyParser({keepExtensions: true, _fileName: function() { }}));
0
source

All Articles