Hey there! I recently started working with Angular 6 and I've encountered an issue trying to fetch images, documents, or Excel files from an AWS S3 bucket. Here's the code I'm using:
var S3 = new AWS.S3();
const params = {
Bucket: 'asdasd',
accessKeyId: '[accessKeyId]',
secretAccessKey: '[secretAccessKey]',
}
S3.listObjects(params, function (err, data) {
if (err) {
console.log('There was an error getting your files: ' + err);
return;
}
console.log('Successfully retrieved files.', data);
const fileDatas = data.Contents;
fileDatas.forEach(function (file) {
});
});
I encountered this error message:
MultipleValidationErrors: There were 3 validation errors:
* UnexpectedParameter: Unexpected key 'region' found in params
* UnexpectedParameter: Unexpected key 'accessKeyId' found in params
* UnexpectedParameter: Unexpected key 'secretAccessKey' found in params
My goal is to retrieve images from S3 and display them on my HTML page.