Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qiniu-web-uploader

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qiniu-web-uploader

七牛上传模块

  • 2.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

七牛上传模块NPM version NPM downloads MIT License

##功能

  • 七牛分片上传

NPM

npm i qiniu-web-uploader

使用

import Uploader from 'qiniu-web-uploader';

/*
uptoken:
{
  uptoken: 'asdfsdf', //七牛上传凭证
  key: 'sdfa' //base64字符串,new Buffer(key).toString('base64')
}
*/
let uploader = new Uploader(file, uptoken);

uploader.on('progress', () => {
  console.log(uploader.percent); //加载进度
  console.log(uploader.offset); //字节
  console.log(uploader.file); //文件
});
uploader.on('cancel', () => {
  //取消
});
uploader.on('complete', () => {
  console.log(uploader.imgRes); //文件
});

let imgRes = await uploader.upload(); //返回七牛返回的Key
uploader.cancel(); //取消

Keywords

FAQs

Package last updated on 04 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc