Upload file from React JS to AWS S3

  1. Prerequisite: i. Existing S3 bucket, ii. AWS access key ID and secret access key.
  2. Give project CORS permission on S3 bucket. Login to AWS console, go to your S3 bucket → Permission → CORS configuration. Paste the following CORSRule into CORSConfiguration and save.

4. For your react project, npm install aws-sdk.

5. Include this FileUpload component into your project, modify and use it.