uppy qiniu uploader plugin
npm i uppy-qiniu-uploader -S
<div id="select-files"></div>
import "uppy/dist/uppy.css";
import Uppy from "uppy/lib/core";
import Dashboard from "uppy/lib/plugins/Dashboard";
import Qiniu from "uppy-qiniu-uploader";
const uppy = Uppy({
autoProceed: false
})
.use(Dashboard, {
target: "#select-files",
inline: true,
proudlyDisplayPoweredByUppy: false
})
.use(Qiniu, {
host: "http://p7fl7t6sj.bkt.clouddn.com",
getToken() {
// return qiniu upload token
}
})
.run();
uppy.on("complete", result => {
console.log(`Upload complete! We’ve uploaded these files: `, result);
});
root URL of link uploaded file
the method for get qiniu upload token
use file's hash to be file name save in qiniu cloud