Created
March 20, 2017 17:31
-
-
Save mackbrowne/96e0e483dbb58326cf50cb4ddef727a8 to your computer and use it in GitHub Desktop.
Meteor-Slingshot s3 Delete Companion
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
// Found at - https://github.com/CulturalMe/meteor-slingshot/issues/50#issuecomment-80965314 | |
// Add s3 package from atmosphere | |
AWS.config.update({ | |
accessKeyId: Meteor.settings.private.amazonS3.AWSAccessKeyId, | |
secretAccessKey: Meteor.settings.private.amazonS3.AWSSecretAccessKey | |
}); | |
var s3 = new AWS.S3(); | |
var params = { | |
Bucket: Meteor.settings.private.amazonS3.bucket, | |
Key: data.Key | |
}; | |
var deleteObject = Meteor.wrapAsync( | |
s3.deleteObject(params, function(error, data) { | |
if(error) { | |
console.log(error); | |
} else { | |
console.log(data); | |
} | |
}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment