Skip to content

Commit

Permalink
Proposed browser support change.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanpeck committed Oct 13, 2014
1 parent a8cf486 commit 932da15
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
config.json
config.json
video.mp4
6 changes: 3 additions & 3 deletions examples/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ AWS.config.loadFromPath('./config.json');
s3Stream.client(new AWS.S3());

// Create the streams
var read = fs.createReadStream('path/to/file');
var read = fs.createReadStream('./video.mp4');
var compress = zlib.createGzip();
var upload = new s3Stream.upload({
"Bucket": "bucket-name",
"Key": "key-name"
"Bucket": "storydesk",
"Key": "video.mp4.gz"
});

// Handle errors.
Expand Down
6 changes: 4 additions & 2 deletions lib/s3-upload-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ module.exports = {
receivedBuffers.push(remainder);
receivedBuffersLength = remainder.length;

// Return the original buffer.
return combinedBuffer.slice(0, partSizeThreshold);
// Return the perfectly sized part.
var uploadBuffer = new Buffer(partSizeThreshold);
combinedBuffer.copy(uploadBuffer, 0, 0, partSizeThreshold);
return uploadBuffer;
}
else {
// It just happened to be perfectly sized, so return it.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "s3-upload-stream",
"description": "Writeable stream for uploading content of unknown size to S3 via the multipart API.",
"version": "1.0.4",
"version": "1.0.5",
"author": {
"name": "Nathan Peck",
"email": "[email protected]"
Expand Down

0 comments on commit 932da15

Please sign in to comment.