# react-file-loader

> File Loader Component

Latest version **1.2.3** (published 2017-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-file-loader
pnpm add react-file-loader
yarn add react-file-loader
bun add react-file-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2017-04-15 |
| First published | 2017-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Gayane Gasparyan |
| Maintainers | ggayane |
| Keywords | react, reactjs, file, loader, reload, webpack |

## Links

- npm: https://www.npmjs.com/package/react-file-loader
- Repository: https://github.com/Ggayane/react-file-loader
- Issues: https://github.com/Ggayane/react-file-loader/issues
- npm.io page: https://npm.io/package/react-file-loader

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^0.14.6
- [react-dom](https://npm.io/package/react-dom.md) ^0.14.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.3 (latest) — 2017-04-15
- 1.2.1 — 2017-04-15
- 1.2.0 — 2017-04-15
- 1.1.2 — 2017-04-14
- 1.1.1 — 2017-04-05
- 1.1.0 — 2017-04-05
- 1.0.4 — 2017-04-03
- 1.0.3 — 2017-04-03
- 1.0.2 — 2017-04-03
- 1.0.1 — 2017-03-31
- 1.0.0 — 2017-03-31

## README

# 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](https://github.com/Ggayane/react-file-loader) 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](http://browserify.org), [Webpack](http://webpack.github.io/), etc).

```
npm install react-file-loader --save
```

## Usage

```jsx
import FileLoader from 'react-input-validation';

<FileLoader
  file={this.state.file || null}
  requestSuccessParam='status'
  requestSuccessVal='ok'
  url={'your link here'} />
```
see more in [examples](https://github.com/Ggayane/react-file-loader/tree/master/examples)

## Props

| Name | Default | Type | Description |
|------|---------|------|-------------|
| **file?** | | object | uploaded file |
| **url?** | | string | url to upload a file |
| **preventReload?** | false | boolean | show alert dialog on page reload while file is uploading |
| **requestSuccessParam?** | | string | uploaded response param for checking |
| **requestSuccessVal?** | | string | successfully upload response param value  |
| **validFileTypes?** | ['image/jpeg', 'image/png', 'video/mp4'] | array | valid file types |
| **fileMaxSize?** | 1024 | number | uploaded file maximum size |
| **uploadFinishedCallback?** | | function | function to call after file upload is done |
| **additionalData?** | | object | additional data to send with the file: {firstName: 'John'} |

## Screenshot

![0.0.1](https://media.giphy.com/media/kkx4J09GMcZLa/giphy.gif)

---
_Source: https://npm.io/package/react-file-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
