1.0.2 • Published 3 years ago

rc-upload-file v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

rc-upload-file

select the image and upload it to the back endInstall.

Installation

$ yarn add rc-upload-file

or

$ npm install rc-upload-file

Quick start

import React from 'react';
import ReactDOM from 'react-dom';
import UploadFile from 'rc-upload-file';

function App() {
  return(
    <div className='app'>
      <UploadFile 
      	action="https://example.com/upload"
      	multiple
        accept="*"
      />
    </div>
  );
}

ReactDOM.render(<App />, document.getElementById('root'));

API

propsdescriptiontyperequireddefault
actionabsolute path to uploadstringtrue
acceptfile type MIMEstringfalseimage/*
multiplewhether to allow multiple files to be selectedbooleanfalsefalse

Contribute

  • Fork this Repo first
  • Clone your Repo
  • Install dependencies by $ npm install
  • Checkout a feature branch
  • Feel free to add your features
  • Make sure your features are fully tested
  • Publish your local branch, Open a pull request
  • Enjoy hacking <3