lanyunit-uploader
v1.0.6
Published
Integrate local, Tencent Cloud COS, Alibaba Cloud OSS, and Qiniu Cloud uploads
Downloads
69
Readme
Uploader JS
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.