UNPKG

file-fragment-upload

Version:

文件分片上传 获取文件hash值 文件分片

29 lines (25 loc) 626 B
##### 使用组件 ```ts import FileFragmentUpload from 'file-fragment-upload'; <FileFragmentUpload uploadFiles={(files: Files) => { // operate }} > /*** view demo ***/ <div style={{width: '100px' , height: '100px', background: 'pink'}} > 点击或拖动上传 </div> /*** view demo ***/ </FileFragmentUpload> ``` ##### 获取上传文件的hash值(md5值) ```ts import { getFileHash } from 'file-fragment-upload'; const hash = await getFileHash(file); // file: File ``` ##### 文件分片 ```ts import { getChunk } from 'file-fragment-upload' const fileChunk = getChunk(file, startByte, endByte); ```