lundi 31 août 2015

Uploading multiple files at same time from local to s3 bucket through node js

I am trying to upload a files to the s3 bucket,The following code I am using to accomplish this operation.

var params = {
  localFile: "../Processor/1.wav",

  s3Params: {
    Bucket: "bucketname",
    Key: "1.wav",
  },
};
var uploader = client.uploadFile(params);
uploader.on('error', function(err) {
  console.error("unable to upload:", err.stack);
});
uploader.on('progress', function() {
  console.log("progress", uploader.progressMd5Amount,
            uploader.progressAmount, uploader.progressTotal);
});
uploader.on('end', function() {
  console.log("done uploading");
});

Every thing works fine till this point. Now lets say here, I want to upload 5 files from local path to s3 bucket, How can I achieve that is there any direct method providing amazon for multiple file uploads or I need to use async module.?




Aucun commentaire:

Enregistrer un commentaire