Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

not able to sync/ upload a local folder to S3 #224

Open
ManojKumarHC opened this issue Jul 15, 2019 · 0 comments
Open

not able to sync/ upload a local folder to S3 #224

ManojKumarHC opened this issue Jul 15, 2019 · 0 comments

Comments

@ManojKumarHC
Copy link

Hi ,

I am trying to sync entire local directory to S3 bucket which is in ap-south-1 , if the bucket is in other region .. syncing a directory is working as expected . in the ap-south-1 region also My code is not throwing any error , it is coming with grace full exit . but the folder is not getting synced / uploaded to S3 . below given my code . Please help me out to solve this . Any help will be greatly appreciated .

const AWS = require('aws-sdk');
const s3 = require('s3');

const awsS3Client = new AWS.S3( {
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
region: 'ap-south-1',
signatureVersion: 'v4'
});

const client = s3.createClient({
s3Client: awsS3Client
} );

var params = {
localDir: './' + local1
deleteRemoved: false, // default false, whether to remove s3 objects
// that have no corresponding local file.

        s3Params: {
          Bucket: mybucket1,
          Prefix: "/<path>",
          ACL: 'public-read'
        },
};

      var uploader = client.uploadDir(params);
      uploader.on('error', function(err) {
        console.error("unable to sync:", err.stack);
      });
      uploader.on('progress', function() {
        console.log("progress", uploader.progressAmount, uploader.progressTotal);
      });
      uploader.on('end', function() {
        console.log( "done uploading" );
       // delet.postcall( orderno );
      });
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant