admin管理员组文章数量:1434916
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 badges1 Answer
Reset to default 5Try this
fetch('https://bucketnmame.s3.amazonaws./folder1/folder2/file.txt')
.then ((response) => response.text())
.then (data => {
console.log(data)
});
本文标签: javascriptRead txt file from AWS S3 storage in ReactJSStack Overflow
版权声明:本文标题:javascript - Read .txt file from AWS S3 storage in ReactJS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745621399a2666703.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论