I am trying to read text file from s3 storage in ReactJS. I have the s3 bucket link of the text file. However, I am not able to read the text file from the link. I have googled a lot about this, but everywhere people are reading the file locally and not from a link.
The link of the file looks like this:
https://bucketnmame.s3.amazonaws.com/folder1/folder2/file.txt
This link is being stored in database with NodeJS as backend. Would be great if someone helps me...
Try this
fetch('https://bucketnmame.s3.amazonaws.com/folder1/folder2/file.txt')
.then ((response) => response.text())
.then (data => {
console.log(data)
});