Skip to content

Instantly share code, notes, and snippets.

@mackbrowne
Created March 20, 2017 17:31
Show Gist options
  • Save mackbrowne/96e0e483dbb58326cf50cb4ddef727a8 to your computer and use it in GitHub Desktop.
Save mackbrowne/96e0e483dbb58326cf50cb4ddef727a8 to your computer and use it in GitHub Desktop.
Meteor-Slingshot s3 Delete Companion
// 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