Skip to content

Instantly share code, notes, and snippets.

@realguess
Created March 10, 2015 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save realguess/47c89c428ad7ab264a86 to your computer and use it in GitHub Desktop.
Save realguess/47c89c428ad7ab264a86 to your computer and use it in GitHub Desktop.
A starter template for using Amazon S3 with Amazon SDK.
// 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