An easy to guide to setup an AWS S3 bucket and upload files to it from a React frontend
Steps to follow
-
Create the AWS S3 bucket as mentioned here
-
Clone this repository
-
Run
npm install
The
react-aws-s3
package, has been used to facilitate the file uploads to th S3 bucket -
Create a
.env
file at the root of the repository and add the details in the following formatREACT_APP_BUCKET_NAME=your-bucket-name REACT_APP_REGION=add the location of your bucket (eg: us-west-2) REACT_APP_ACCESS=got-from-the-security-credentials REACT_APP_SECRET=got-from-the-security-credentials
-
Run
npm start
to start the server onPORT 3000
On uploading a file, it will get uploaded to the S3 bucket!