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

I am trying to read text file from s3 storage in ReactJS. I have the s3 bucket link of the text file. H

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)
    });

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745621400a4636538.html

相关推荐

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

    I am trying to read text file from s3 storage in ReactJS. I have the s3 bucket link of the text file. H

    22天前
    100

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信