1var AWS = require('aws-sdk');
2AWS.config.update({
3 accessKeyId: 'xxx',
4 secretAccessKey: 'xxx'
5 });
6var s3 = new AWS.S3();
7var params = {
8 Bucket : 'bucketname', /* Another bucket working fine */
9 CopySource : 'bucketname/externall/1.txt', /* required */
10 Key : "1.txt", /* required */
11 ACL : 'public-read',
12};
13s3.copyObject(params, function(err, data) {
14 if (err)
15 console.log(err, err); // an error occurred
16 else {
17 console.log(data); // successful response
18 }
19});