I want to upload some large files directly to s3 via the browser with NodeJS, it is unclear how to prepare this file for upload to s3. There might be a better module (like Knox) to handle this case but I am not sure. Any thoughts?
File Object
file: {
webkitRelativePath: '',
lastModifiedDate: '2013-06-22T02:43:54.000Z',
name: '04-Bro Safari & UFO! - Animal.mp3',
type: 'audio/mp3',
size: 11082039
}
S3 putObject
var params = {Bucket: 'bucket_name/'+req.user._id+'/folder', Key: req.body['file']['name'], Body: ???};
s3.putObject(params, function(err, data) {
if (err)
console.log(err);
else
console.log("Successfully uploaded data to myBucket/myKey");
});