How to create AWS S3 file explorer in angularjs

AWS AngularJs S3 Explorer :

Set up presigned URL for S3 file path –

s3.getSignedUrl('getObject'{
      Bucket: 'your bucket name',
      Expires: 60 * 60,    //This means that url valid for 1 hour
      Key: 'profile-image/xxxxxxxxxx.jpg'    //profile-image is the folder name that is already created in the bucket 
  }, function(err, url){
           if(err) {
           console.log(err);
      }
         else {
          var profileImage = url;
      }
  }

CORS configuration –

 
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedOrigin>http://media.los.knabfinance.com.s3.amazonaws.com</AllowedOrigin>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>DELETE</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>


Bucket Policy –
[Code language=”json”]
{
“Version”: “2012-10-17”,
“Statement”: [
{
“Sid”: “PublicListGet”,
“Effect”: “Allow”,
“Principal”: “*”,
“Action”: [
“s3:List*”,
“s3:Get*”
],
“Resource”: [
“arn:aws:s3:::bucket_name”,
“arn:aws:s3:::bucket_name/*”
]
}
]
}
[/code]

Reference source :  https://github.com/awslabs/aws-js-s3-explorer