Answers for "move file from one folder to another in aws s3 nodejs"

1

move file from one folder to another in aws s3 nodejs

var AWS = require('aws-sdk');
AWS.config.update({
     accessKeyId: 'xxx',
     secretAccessKey: 'xxx'
    });
var s3 = new AWS.S3();
var params = {
    Bucket : 'bucketname', /* Another bucket working fine */ 
    CopySource : 'bucketname/externall/1.txt', /* required */
    Key : "1.txt", /* required */
    ACL : 'public-read',
};
s3.copyObject(params, function(err, data) {
    if (err)
        console.log(err, err); // an error occurred
    else {
        console.log(data); // successful response
    }
});
Posted by: Guest on March-02-2020

Code answers related to "move file from one folder to another in aws s3 nodejs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language