Organizational Research By

Surprising Reserch Topic

copying files from one folder to another folder in s3 of same bucket node js


copying files from one folder to another folder in s3 of same bucket node js  using -'javascript,node.js,amazon-web-services,amazon-s3'

I am trying to copy a file from one folder to another folder in same bucket, But I am gettnin Access denined error. But if I try to do it on two different buckets means its wokring fine.

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', /* 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
    }
});
asked Sep 7, 2015 in Node js by rajesh
recategorized Sep 9, 2015 by rajesh
0 votes
14 views



Related Hot Questions



Government Jobs Opening


...