kodobe-react-upload
v2.0.8
Published
Kodobe React Upload
Downloads
4
Readme
Kodobe React Upload
This is a simple react upload package, it can also be extended to be a file dragger.
Install
npm install kodobe-react-upload
or
yarn add kodobe-react-upload
Setup
import Upload from 'kodobe-react-upload';
Usage
import Upload from "kodobe-react-upload";
function App() {
return (
<div>
<h3>Here is how to use a upload</h3>
<br />
<Upload
onChange={(e) => console.log(e)}
uploadUrl="https://api.devtot.com/message/file-upload"
fileName="file_upload"
/>
</div>
);
}
Options
- children: Any thing, Upload becomes standalone if empty
- maxSize: maxSize file can be (number)
- uploadUrl: (string)
- fileName: upload file name (string)
- title: upload button title (string)
- headers: provide headers if required (objects)
- onChange: view progress of file as it uploads (function)
- dragger: turns upload to a file dragger and allows multiple uploads (boolean, default=false)
- maxUpload: maximum file the dragger can take (number, default=10)