I try to copy a file from one folder to another folder in the same bucket, but I get gettnin Access denined error. But if I try to do this on two different buckets, it means that it works great.
Please find what I have tried so far below:
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: 'xxx',
secretAccessKey: 'xxx'
});
var s3 = new AWS.S3();
var params = {
Bucket : 'bucketname',
CopySource : 'bucketname/externall/1.txt',
Key : "1.txt",
ACL : 'public-read',
};
s3.copyObject(params, function(err, data) {
if (err)
console.log(err, err);
else {
console.log(data);
}
});
source
share