0.0.14 • Published 6 years ago

oa-uploader v0.0.14

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

Base

OaUploader is base on HTML5 FILE API

Install

npm install oa-uploader

then

import OaUploader from 'oa-uploader'

or

<script src="//unpkg.com/oa-uploader"></script>

Options

optiondetailtypedefault
filesupload file arrayArray---
chunkSizechunk sizeNumber(1 << 20) * 5
parallelupload parallel numberNumber3
fileParallelfile parallel numberNumber2
md5enable md5 calculateBooleanfalse
maxMd5Sizemax md5 calculate sizeNumber(1 << 20) * 5000
autoUploadauto uploadBooleantrue
onBeforeUpload(file)before upload hookFunctionnull
onBeforeSend(file, formdata)before request hookFunctionnull
onProgress(file, progress, speed)progress hookFunctionnull
onOverAllProgress(progress)uploaded hookFunctionnull
onAbort(file)abort hookFunctionnull
onError(file)error hookFunctionnull
onLoad(file, res)success upload hookFunctionnull
elfile input elementString/DOMnull
onDragdrag drop hookFunctionnull

INSTANCE FUNCTION

namedetailargument
retry重试index
pause暂停index
delete删除index
stopAll全部停止null
retryAll全部重试null
addFiles增加新文件[file]

Usage

<input type="file" id="files" multiple>

window.onload = function () {
    document.querySelector('#files')
        .addEventListener('change', function(e) {
            new OaUploader({
                files: e.target.files,
                md5: true,
                uploadUrl: '/upload',
                parallel: 3
            });
        });
}

ISSUE

  • 文件上传过程中重命名处理
0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago