Using client.putFile - Automattic/knox GitHub Wiki
client.putFile(filePath, newFileName, headers, function(err, res) {
if (err) return;
else if (200 == res.statusCode) {
var awsData = res.socket._httpMessage;
console.log('Uploaded to S3: ', awsData.url);
}
});
Sample headers, x-amz-acl is the aws view permissions for this file.
var headers = {
'Content-Type': 'application/pdf',
'x-amz-acl': 'public-read'
};