1.0.11 • Published 5 months ago

lanyunit-uploader v1.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Uploader JS

Latest Version on Packagist Total Downloads

Integrate local, Tencent Cloud COS, Alibaba Cloud OSS, and Qiniu Cloud uploads

Installation

You can install the package via npm:

npm i lanyunit/laravel-uploader

Usage

import Uploader from "lanyunit-uploader";

const uploader = new Uploader({
    type: "image",
    // when token expire
    onGetConfig: (callback, data) => {
        fetch("http://your-domain.com/upload/config", data).then(async (res) => {
            callback(await res.json());
        });
    },
});

// upload file
uploader.send({
    file: new File(yourfile, "file.txt"),
    onSuccess: (response) => {
        console.log(response.url);
    },
    onFail: (err) => {
        console.log(err.message);
    },
    onProgress: ({ loaded, total, percent }) => {
        //
    },
});

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.2

9 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

9 months ago

1.0.1

2 years ago

1.0.0

2 years ago