Created
March 10, 2015 09:42
-
-
Save realguess/47c89c428ad7ab264a86 to your computer and use it in GitHub Desktop.
A starter template for using Amazon S3 with Amazon SDK.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put message to S3. | |
var aws = require('aws-sdk'); | |
aws.config.update({ | |
accessKeyId: 'accessKeyId', | |
secretAccessKey: 'secretAccessKey', | |
region: 'us-east-1' | |
}); | |
var s3 = new aws.S3(); | |
// s3.putObject | |
function s3putObject(body, done) { | |
s3.putObject({ | |
Bucket: 'bucket', | |
Key: 'key', | |
Body: body | |
}, function (err, data) { | |
console.error(err ? err : data); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment