Node js file upload to s3 or local

I want to create a file upload service for node backend

The files can be uploaded to amazon s3 bucket or local server depending on the configuration.

As far as I understood

I can use s3-upload stream to upload to s3 bucket. I have the following question

  1. In the example on npm mpdule page

    var read = fs.createReadStream('./path/to/file.ext');

The stream is created using local file. How can I read input stream from client and pipe it to s3. Can I use formidable for this ?

The file size can be very large. The upload service should be production ready serving multiple requests. Point to any documentation or guide for my use case will be very helpful

You can use AWS JavaScript SDK for S3. There are some examples of using Node.js.

There is node.js SDK for AWS available out there that already has methods to upload to S3. http://aws.amazon.com/sdk-for-node-js/