All Projects → mother → React Files

mother / React Files

Licence: mit
A file input (dropzone) management component for React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Files

Uploadcare Widget
Uploadcare Widget, an ultimate tool for HTML5 file upload supporting multiple file upload, drag&drop, validation by file size/file extension/MIME file type, progress bar for file uploads, image preview.
Stars: ✭ 183 (+45.24%)
Mutual labels:  files, image, upload, file
Aetherupload Laravel
A Laravel package to upload large files 上传大文件的Laravel扩展包
Stars: ✭ 835 (+562.7%)
Mutual labels:  files, upload, file
File Upload With Preview
🖼 A simple file-upload utility that shows a preview of the uploaded image. Written in pure JavaScript. No dependencies. Works well with Bootstrap 4 or without a framework.
Stars: ✭ 352 (+179.37%)
Mutual labels:  image, upload, file
PHP-FileUpload
Simple and convenient file uploads — secure by default
Stars: ✭ 53 (-57.94%)
Mutual labels:  files, upload, file
Pomf
Simple file uploading and sharing
Stars: ✭ 535 (+324.6%)
Mutual labels:  files, upload, file
Angular File Uploader
Angular file uploader is an Angular 2/4/5/6/7/8/9/10 + file uploader module with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility, localization and multiple themes which includes Drag and Drop and much more.
Stars: ✭ 92 (-26.98%)
Mutual labels:  image, upload, file
Chibisafe
Blazing fast file uploader and awesome bunker written in node! 🚀
Stars: ✭ 657 (+421.43%)
Mutual labels:  files, upload, file
Uploader
A lightweight and very configurable jQuery plugin for file uploading using ajax(a sync); includes support for queues, progress tracking and drag and drop.
Stars: ✭ 1,042 (+726.98%)
Mutual labels:  upload, file, drop
Angular Filepond
🔌 A handy FilePond adapter component for Angular
Stars: ✭ 59 (-53.17%)
Mutual labels:  upload, file
Fileuploaderplugin
Simple cross platform plugin to upload files.
Stars: ✭ 59 (-53.17%)
Mutual labels:  upload, file
Nodestream
Storage-agnostic streaming library for binary data transfers
Stars: ✭ 70 (-44.44%)
Mutual labels:  upload, file
Miniflix
Miniflix - A smaller version of Netflix powered by Cloudinary
Stars: ✭ 58 (-53.97%)
Mutual labels:  image, upload
Express Fileupload
Simple express file upload middleware that wraps around busboy
Stars: ✭ 1,069 (+748.41%)
Mutual labels:  files, upload
Laravel Simple Uploader
Simple file uploader for Laravel 5.
Stars: ✭ 59 (-53.17%)
Mutual labels:  upload, file
File Dialog
Trigger the upload file dialog directly from your code easily.
Stars: ✭ 51 (-59.52%)
Mutual labels:  upload, file
Laravel Imageupload
Upload image using Laravel's build in function and resize it automatically.
Stars: ✭ 73 (-42.06%)
Mutual labels:  image, upload
React Images Uploading
The simple images uploader applied Render Props pattern that allows you to fully control UI component and behaviors.
Stars: ✭ 80 (-36.51%)
Mutual labels:  image, upload
Droply Js
Droply JS, a new responsive and cross browser chunk uploader with DragDrop and File Preview capabilities (HTML5/CSS3)
Stars: ✭ 50 (-60.32%)
Mutual labels:  upload, file
Github Files Fetcher
Download a specific folder or file from a GitHub repo through command line
Stars: ✭ 73 (-42.06%)
Mutual labels:  files, file
Jquery Filepond
🔌 A handy FilePond wrapper for jQuery
Stars: ✭ 124 (-1.59%)
Mutual labels:  upload, file

react-files

A file input (dropzone) management component for React

Demo

Alt text

Installation

Install from NPM and include it in your own React build process (using Browserify, Webpack, etc).

npm install react-files --save

Usage

Basic

import React from 'react'
import ReactDOM from 'react-dom'
import Files from 'react-files'

var FilesDemo = React.createClass({
  onFilesChange: function (files) {
    console.log(files)
  },

  onFilesError: function (error, file) {
    console.log('error code ' + error.code + ': ' + error.message)
  },

  render: function() {
    return (
      <div className="files">
        <Files
          className='files-dropzone'
          onChange={this.onFilesChange}
          onError={this.onFilesError}
          accepts={['image/png', '.pdf', 'audio/*']}
          multiple
          maxFiles={3}
          maxFileSize={10000000}
          minFileSize={0}
          clickable
        >
          Drop files here or click to upload
        </Files>
      </div>
    )
  }
})

ReactDOM.render(<FilesDemo />, document.getElementById('container'))

Advanced

See "Tinker" instructions below to run and view all examples.

Tinker

git clone https://github.com/mother/react-files
npm install

And since React is just a peer dependency:

npm install react

Then:

npm run dev

Then visit http://localhost:8080/

Build

npm run build

Props

onChange(files) - Function

Perform work on files added when submit is clicked.


onError(error, file) - Function

  • error.code - Number
  • error.message - String

Perform work or notify the user when an error occurs.

Error codes are:

  1. Invalid file type
  2. File too large
  3. File too small
  4. Maximum file count reached

accepts - Array of String

Control what types of generic/specific MIME types or file extensions can be dropped/added.

See full list of MIME types here: http://www.iana.org/assignments/media-types/media-types.xhtml

Example:

accepts={['image/*', 'video/mp4', 'audio/*', '.pdf']}

multiple - Boolean

Default: true

Allow multiple files


clickable - Boolean

Default: true

Dropzone is clickable to open file browser. Disable for dropping only.


maxFiles - Number

Default: Infinity

Maximum number of files allowed


maxFileSize - Number

Default: Infinity

Maximum file size allowed (in bytes)


minFileSize - Number

Default: 0

Minimum file size allowed (in bytes)


dropActiveClassName - String

Default: 'files-dropzone-active'

Class added to the Files component when user is actively hovering over the dropzone with files selected.


Test (todo)

npm test

License

MIT. Copyright (c) 2016 Jared Reich.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].