file-fragment-upload
v3.0.0
Published
文件分片上传 获取文件hash值 文件分片
Downloads
3
Maintainers
Readme
使用组件
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值)
import { getFileHash } from 'file-fragment-upload';
const hash = await getFileHash(file); // file: File
文件分片
import { getChunk } from 'file-fragment-upload'
const fileChunk = getChunk(file, startByte, endByte);