Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading file using Node to a stream without first writing to temp file disk?

Is there a way to stream directly to a remote server or fileshare when handling Node.js file uploads? I'm using formidable and currently I am trying to enable this scenario, but it always ends up writing to a temp file on my server first, which in my mind is unnecessary if the ultimate destination is a remote server.

I also tried connect-form which is built on top of formidable, but didn't find any good documentation for onPart/handlePart, which I assume allows me to do this. Does anybody have a pointer to a good example which enables this scenario?

like image 946
Jim Wang Avatar asked Nov 14 '22 15:11

Jim Wang


1 Answers

Turns out the Formidable team is working on making this scenario much easier with Node.js streams. When the issue is fixed this will become much easier.

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

like image 180
Jim Wang Avatar answered Nov 16 '22 18:11

Jim Wang