Giter Site home page Giter Site logo

breakpoint-upload's Introduction

breakpoint-upload

使用html5开发的断点续传组件

--

特点:

原生javascript编写,不依赖任何类库。基于HTML5 File API,兼容至IE10+。

API:

var up = upload(option);
up.upload();   //上传
up.pause();    //暂停
up.remove();   //删除

//option:
types;         //@String 文件上传类型限制,用|分割,* 为默认值不限制
uploader;      //@String 提交到后端处理的文件地址, 必选项
fileName;      //@String 后端接受到文件键值
multifile;     //@boole 是否开启多文件上传 默认为true
listItem;      //@String 上传列表展示的项目有'name|progress|type|size|state|remove', 默认'name|state'
method;        //@String 请求方式
formData;      //@Object 提交到后端的附加参数 格式为json
fileMax;       //@Number 单个文件的大小限制 单位kb 默认2MB
fileSplitSize; //@Number 断点分割的文件块大小 单位bytes 默认1MB
dragElement;   //@Object 拖拽上传dom元素 可选
selectBtn;     //@Object 选择文件的button, 必选项
listParent;    //@Object 用于展现项目列表元素父级element 必选项
onFileChange;  //@Function 获取file列表
onUploadSucc;  //@Function 每个文件上传成功回调
onUploadErr;   //@Function 每个文件上传失败回调

详见 upload.js

breakpoint-upload's People

Contributors

stoneweb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.