big-little-file

0.2.2 • Public • Published

big-little-file

A Javascript utility for uploading both small and huge files.

See the example-app README and the example code, or follow these directions:

Add to your package.json:

"big-little-file": "^0.2.0"

And then in your React component or action:

let bigLittle = await BigLittleFile.create(
    'https://cdsdeva.catalyticds.com/yacht/api/data/files',
    `Bearer ${this.state.jwt}`,
    file,
    {
        name: file.name,
        group: 'My Upload Test Files'
    }
);

bigLittle.upload(progressData => {
    console.log(progressData.uploadedBytes + " completed of " + progressData.totalBytes);
}).then(fileInfo => {
    console.log("File fully uploaded to: " + fileInfo.path);
}).catch(err => {
    console.log(err);
});

Readme

Keywords

Package Sidebar

Install

npm i big-little-file

Weekly Downloads

1

Version

0.2.2

License

Apache-2.0

Unpacked Size

62.3 kB

Total Files

7

Last publish

Collaborators

  • rsby