https://github.com/gndx/react-aws-s3-uploader
It provides an easy-to configure component to Uploading Photos to Amazon S3 from your React project.
https://github.com/gndx/react-aws-s3-uploader
aws react s3 uploader
Last synced: about 1 year ago
JSON representation
It provides an easy-to configure component to Uploading Photos to Amazon S3 from your React project.
- Host: GitHub
- URL: https://github.com/gndx/react-aws-s3-uploader
- Owner: gndx
- License: mit
- Created: 2019-06-30T06:43:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T03:19:50.000Z (over 3 years ago)
- Last Synced: 2024-11-28T18:18:38.251Z (over 1 year ago)
- Topics: aws, react, s3, uploader
- Language: JavaScript
- Homepage: https://arepa.dev
- Size: 1.88 MB
- Stars: 16
- Watchers: 4
- Forks: 5
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-aws-s3-uploader
It provides an easy-to configure component to Uploading Photos to Amazon S3 from your React project.
Based on this documentation:
[Uploading Photos to Amazon S3 from a Browser"](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-photo-album.html)

# Install
```npm
npm install react-aws-s3-uploader --save
```
Be sure to include the --save option to add this as a dependency in your application's package.json
# Usage
```js
import React, { Component } from 'react';
import S3Uploader from 'react-aws-s3-uploader'; // import the component
class App extends Component {
state = {
file: '',
}
handleFile = (file) => {
this.setState({
file
});
}
render() {
return (
);
}
}
export default App;
```
# Options
### buttonName
Name of button, default is "Upload File".
### bucketRegion
The bucket region of AWS.
### albumBucketName
Name of bucket where the files are stored.
### IdentityPoolId
Amazon Cognito identity pools provide temporary AWS credentials for users who are guests (unauthenticated) and for users who have been authenticated and received a token. An identity pool is a store of user identity data specific to your account. More info: [Using Identity Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/identity-pools.html)
### handleFile
funtion to return the url of the file stored in s3.
## Example:
```js
```
# Demo
Check here: [react-aws-s3-uploader](https://arepa-dev.github.io/reactAWSUploader/)
# Contributing
If someone wants to add or improve something, I invite you to collaborate directly in this repository: [react-mailchimp-form](https://github.com/gndx/react-aws-s3-uploader)
# License
React-mailchimp-form is released under the [MIT License](https://opensource.org/licenses/MIT).