1.2.3 • Published 7 years ago

react-file-loader v1.2.3

Weekly downloads
14
License
MIT
Repository
github
Last release
7 years ago

react-file-loader

This component helps you to build a file uploader very easily. You just need to have a file input in your application and give a file to File uploader component and it will done the "dirty" work for you :smirk:

How to get started ?

Install

npm install

Start

npm start

Installation

The easiest way to use react-file-loader is to install it from NPM and include it in your own React build process (using Browserify, Webpack, etc).

npm install react-file-loader --save

Usage

import FileLoader from 'react-input-validation';

<FileLoader
  file={this.state.file || null}
  requestSuccessParam='status'
  requestSuccessVal='ok'
  url={'your link here'} />

see more in examples

Props

NameDefaultTypeDescription
file?objectuploaded file
url?stringurl to upload a file
preventReload?falsebooleanshow alert dialog on page reload while file is uploading
requestSuccessParam?stringuploaded response param for checking
requestSuccessVal?stringsuccessfully upload response param value
validFileTypes?'image/jpeg', 'image/png', 'video/mp4'arrayvalid file types
fileMaxSize?1024numberuploaded file maximum size
uploadFinishedCallback?functionfunction to call after file upload is done
additionalData?objectadditional data to send with the file: {firstName: 'John'}

Screenshot

0.0.1

1.2.3

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago