Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

streaming file uploads to s3, without touching the disk

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 example.js
Octocat-spinner-32 index.html
Octocat-spinner-32 knox-stream.js
Octocat-spinner-32 package.json
Octocat-spinner-32 readme.md
Octocat-spinner-32 server.js
readme.md

streamr

This is an experiment to see how well node can handle streaming file uploads directly to S3, without touching the file system on the server. To do this, it uses modified versions of node-formidable to handle the file parsing and knox to push the files out to S3.

Formidable has been changed to accept a custom WriteStream, instead of the default fs.WriteStream. Knox's client.putStream method has been updated to expect any type of stream, not just a file stream (and to use stream.pipe instead of manual event bindings).

Example

To run the example app you'll need to set your AWS creds (and bucket name) as environment variables.

$ export AWS_KEY=(your aws key) AWS_SECRET=(your secret) BUCKET_NAME=(bucket name)
$ node server
> server listening on port 3000

Once the demo is running, just drag a file into the window and it will upload straight to your S3 bucket. Check the console for file info.

Contributings

I'd love feedback, so please open a pull request or submit an issue!

Something went wrong with that request. Please try again.