I've been attempting to retrieve an s3 file from my bucket using this function:
async Export()
{
const myKey = '...key...'
const mySecret = '...secret...'
AWS.config.update(
{
accessKeyId: myKey,
secretAccessKey: mySecret
}
);
var s3 = new AWS.S3();
s3.getObject({
Bucket: '...bucket...',
Key: '...filepath...'
},
function(error, data)
{
if (error != null)
{
alert("Failed to retrieve object: " + error)
}
else {
alert("Loaded " + data.ContentLength + " bytes")
}
})
}
After running the function, I receive a message indicating that I have successfully loaded a file consisting of a certain number of bytes. However, my main objective is to download the file onto my local machine. Do I need to implement a file stream mechanism here?
Additional Information
We are utilizing Angular Typescript, not AngularJS