Created
April 14, 2014 13:18
-
-
Save abishekrsrikaanth/10647012 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var AWS = require('aws-sdk'); | |
AWS.config.update({accessKeyId: '{my_access_id}', secretAccessKey: '{my_secret_key}'}); | |
var s3 = new AWS.S3(); | |
var params = { | |
Bucket: 'bucket_name', | |
Key: key, | |
ACL: 'public-read', | |
Body: file_name | |
}; | |
//This doesn't work | |
var request = s3.putObject(params, function (err, data) { | |
//Do something after the file is uploaded | |
}; | |
//This works | |
var request = s3.client.putObject(params, function (err, data) { | |
//Do something after the file is uploaded | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment