1 Star 0 Fork 1

Augly / bigfileupload

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

安装

npm install bigfileupload

引用

important { BigFileUpload } from "bigfileupload"

配置项

option:{
      //切片尺寸
      sliceSize: 0.1 * 1024 * 1024,
      //为一个函数接收三个参数(sliceFile,next,error)=>{},该函数作用于上传文件切片,调用next()执行下一个,调用error()主动抛出错误,停止上传,
      uploadFun: (sliceFile, next,error) => { },
      //为一个函数接收两个参数(fileName,hashName)=>{},此函数通知服务器端该文件所有切片已上传完毕,可以合并
      noticeFun: (fileName, hashName) => { },
      //为一个函数接收两个参数(fileName,hashName)=>{},此函数验证该文件在服务器端已上传切片数量,该函数返回2个值,uploaded为布尔值类型,uploadedList为切片hash值组成的数组组成的数组
      verifyFun: (fileName, hashName) => { },
      //为一个函数接收一个参数(progres)=>{},此函数通知用户已上文件的占比
      progressFun: (progres) => { },
      //接收一个status,表示当前上传状态
      status: (status) => { },
      //接收一个msg,表示错误信息
      errorMsg: (msg) => {
        console.error(msg)
      },

创建实例

const upload = new BigFileUpload(option)

方法

load(file):接收需要上传的文件。
//以下方法都在load(file)之后调用
begin():开始上传
again():重新上传
pause():暂停上传
continue():继续上传

空文件

简介

This is a js breakpoint continuation utility class function that supports starting, pausing, re-uploading, and throwing errors on your own initiative。这是一个js断点续传工具类函数,支持开始,暂停,重新上传,并且可以自已主动抛出错误" 展开 收起
JavaScript
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/Q_Augly/bigfileupload.git
git@gitee.com:Q_Augly/bigfileupload.git
Q_Augly
bigfileupload
bigfileupload
master

搜索帮助

14c37bed 8189591 565d56ea 8189591