I will get all the s3 bucket object URL in the Console. How to download that object from client side using Angularjs
app.controller('Sample', function($scope) {
AWS.config.update({
accessKeyId: '',
secretAccessKey: ''
});
AWS.config.region = "us-east-1";
$scope.s3Url = '';
var bucket = new AWS.S3({
params: {
Bucket: 'mybucketname',
Prefix: 'UPLOADS'
}
});
bucket.listObjects(function(err, data) {
if (err) {
console.log(err);
} else {
console.log(data.Contents[1]);
$scope.imgData = $scope.s3Url + data.Contents[1].Key;
console.log($scope.imgData);
}
});
});