Skip to content

marcus-ko/react-image-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Overview

This is a basic react app that allows you to upload images to an aws s3 account. Prior to running this app, make sure that you create an s3 bucket in your aws console.

App.js

Make sure to add your credentials here:

const config = {
  bucketName: 'your-bucket-name',
  dirName: '', /* optional */
  region: 'us-east-1', /* example */
  accessKeyId: process.env.REACT_APP_ACCESS_ID,
  secretAccessKey: process.env.REACT_APP_SECRET_KEY
}

.env.local

And here:

REACT_APP_ACCESS_ID='EXAMPLEACCESSID'
REACT_APP_SECRET_KEY='exampleSecretKey010101'

This file goes in the src folder.

Notes

Please keep in mind that there is a slight delay upon initial upload. Wait a few seconds and the uploaded image should appear at the top of the screen.