I'm attempting to upload a file to my S3 bucket using the aws-s3 library, but I am encountering this error in the console:
https://i.stack.imgur.com/lk47U.png
Here is the code for the component:
<template>
<input type="file" @change="uploadFile(fieldName, $event.target.files)"/>
</template>
<script>
import S3 from 'aws-s3';
export default {
computed: {
config() {
return {
bucketName: 'in-converter-bucket',
dirName: '', /* optional */
region: 'eu-west-2',
accessKeyId: 'AKIAZSUESKSZVZTI55PV',
secretAccessKey: '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',
s3Url: 'https://s3.console.aws.amazon.com/s3/buckets/in-converter-bucket?region=us-west-2&tab=objects', /* optional */
}
},
S3Client() {
return new S3(this.config);
}
},
methods: {
uploadFile(fieldName, files) {
let file = files[0]
this.S3Client
.uploadFile(file, '324')
.then(data => console.log(data))
.catch(err => console.error(err))
}
},
props: ['fieldName', 'obj']
}
</script>
Any assistance would be greatly appreciated