aws/aws-sdk-js — pull request #427 by lsegal (2014-12-04 22:24:11+00:00)
Title: S3 Managed Upload Support

This pull requests adds support for `AWS.S3.upload()`, which allows uploading of large or arbitrarily sized buffer/stream objects in parallel parts (when possible). This PR also adds the `AWS.S3.ManagedUpload` abstraction, which is the underlying object that manages the uploads.

Example usage:

```js
var fs = require('fs');
var zlib = require('zlib');

var body = fs.createReadStream('bigfile').pipe(zlib.createGzip());
var s3obj = new AWS.S3({params: {Bucket: 'myBucket', Key: 'myKey'}});
s3obj.upload({Body: body}).
on('httpUploadProgress', function(evt) { console.log(evt); }).
send(function(err, data) { console.log(err, data) });
```

Or via the ManagedUpload class directly:

```js
var fs = require('fs');
var zlib = require('zlib');

var params = {
Bucket: 'myBucket',
Key: 'myKey',
Body: fs.createReadStream('bigfile').pipe(zlib.createGzip())
}

var upload = new AWS.S3.ManagedUpload({params: params});
upload.on('httpUploadProgress', function(evt) { console.log(evt); });
upload.send(function(err, data) { console.log(err, data) });
```