📌  相关文章
📜  在 aws s3 nodejs 中将文件从一个文件夹移动到另一个文件夹 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:42.383000             🧑  作者: Mango

代码示例1
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
    }
});