Created
February 2, 2017 14:55
-
-
Save deanc/b16b264dd8c74aeab4be0631b5ddba03 to your computer and use it in GitHub Desktop.
Reset meta-data on an object in S3 bucket using AWS Node SDK
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 params = { | |
Bucket: 'bucketname', /* required */ | |
CopySource: '/bucketname/' + key, /* required */ | |
Key: key, /* required */ | |
ACL: 'public-read', /* optional */ | |
ContentType: 'audio/mpeg', /* optional */ | |
MetadataDirective: 'REPLACE', | |
}; | |
s3.copyObject(params, function(err, data) { | |
if (err) console.log(err, err.stack); // an error occurred | |
else console.log(data); // successful response | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment