react-simple-file-upload

1.1.0 • Public • Published

react-simple-file-upload

This is the React Component for simple file upload. Check it out (and sign up for a free trial) at Simple File Upload.

NPM JavaScript Style Guide

Tutorial Blog Post

https://www.simplefileupload.com/blog/easy-react-file-upload

Sample Repo

https://github.com/leenyburger/simple-file-upload-react-demo

Install

npm install --save react-simple-file-upload

Usage

import SimpleFileUpload from 'react-simple-file-upload';

function App() {
  function handleUpload(url) {
    // url of cdn backed file returned
    console.log(url)
  }

  function handleMultipleUpload(files) {
    // Array of file objects returned
  }


  return (
    // Example of single uploader
    <div className="App">
      <main>
        <div className="upload-wrapper">
          <SimpleFileUpload
            apiKey=yourAPIKEY
            onSuccess={handleUpload}
            onDrop={handleOnDrop}
          />
        </div>
      </main>
      
      // Example of multi uploader
      <main>
        <div className="upload-wrapper">
          <SimpleFileUpload
            apiKey="e8557605f1b5ac9b18c913603d29a8c8"
            onSuccess={handleMultipleUpload}
            onDrop={handleOnDrop}
            preview={false}
            multiple={true}
            maxFiles= {5}
            removeLinks={true}
            buttonClass="upload-button"
            buttonText="Upload Images"
          />
        </div>
      </main>
    </div>
  );
}

export default App;

Props Accepted

{ onSuccess, onDrop, width, height, preview, text, resizeWidth, resizeHeight, resizeMethod, tag, accepted, maxFileSize, multiple, maxFiles, removeLinks, buttonText, buttonClass }

License

MIT © Simple File Upload

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.1-beta.30beta
1.1.077latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.077
1.0.10
1.0.00
0.4.00
0.3.10
0.3.00
0.2.00
0.1.11
0.1.00
0.0.30
0.0.20
0.0.1-beta.30
0.0.1-beta.20
0.0.1-beta.10

Package Sidebar

Install

npm i react-simple-file-upload

Weekly Downloads

78

Version

1.1.0

License

MIT

Unpacked Size

34 kB

Total Files

7

Last publish

Collaborators

  • ccummings
  • leenyburger