最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Read .txt file from AWS S3 storage in ReactJS - Stack Overflow

matteradmin3PV0评论

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:

.txt

This link is being stored in database with NodeJS as backend. Would be great if someone helps me...

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./folder1/folder2/file.txt

This link is being stored in database with NodeJS as backend. Would be great if someone helps me...

Share Improve this question asked Sep 17, 2021 at 3:52 AdityaAditya 3702 silver badges15 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Try this

fetch('https://bucketnmame.s3.amazonaws./folder1/folder2/file.txt')
    .then ((response) => response.text())
    .then (data => {
      console.log(data)
    });
Post a comment

comment list (0)

  1. No comments so far