@optisolbusiness/react-native-s3file-upload
v0.0.12
Published
react-native-s3file-upload
Downloads
3
Readme
react-native-s3file-upload
@optisolbusiness/react-native-s3file-upload
Installation
npm i @optisolbusiness/react-native-s3file-upload
npm i react-native-fs
If using iOS please remember to install cocoapods by running: npx pod-install
Usage
import { S3FileUpload } from "@optisolbusiness/react-native-s3file-upload";
// ...
<S3FileUpload
Config={{ s3Region: '', ImageUrl: '', identityPoolId: '', bucketName: '', }}
file={[{name: '',size: '',type: '',uri:''}]}
onProgress={(progress) => }
response={(response) => }
error={(error) => }
/>
To file parameter you can pass the object response from an image picker library, document picker library, or other file selection library that returns an object with a type, uri property representing the file path. You can pass either images, videos, documents to file parameter.
For uploading videos in android size should be less than 40 mb and in ios should be less than 160 mb
Props
| Prop | Type | Description |
:------------ |:---------------| :-----|
| config
| Object
| Mandatory. Pass s3Region, ImageUrl, identityPoolId, bucketName |
| file
| Array of Object
| Mandatory. Need to pass file details |
| response
| Array of Object
| Mandatory. To get Response Object |
| onProgress
| Number
| Optional. Will get progress value |
| error
| Object
| Optional. To get Error response |
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library