React Js : Upload Csv File To Amazon S3 Using Aws Credentials
I want to upload CSV file using react S3 Uploader. I have AWS credentials as well. But I don't know how to use it in React JS. Below is the code I have used. I don't know where to
Solution 1:
You don't pass the credentials to react-s3-uploader
directly. This is would be a HUGE security problem.
You have at least 2 ways of handling this:
- use presigned urls. Which is a way that you give access to an S3 item to upload items without having credentials (credentials are actually in the url). You'll need a backend for doing this. This is also the way that
react-s3-uploader
recommends to do it - use an AWS Cognito Identity pool for unauth users.
Solution 2:
As Radu Diță mentioned already in the second option, use AWS Cognito for that. No need to setup your own backend server + API.
Also, Amplify helps you when you develop with React + AWS.
Here is a good example for your scenario: https://serverless-stack.com/chapters/create-a-login-page.html
Post a Comment for "React Js : Upload Csv File To Amazon S3 Using Aws Credentials"