file-fragment-upload
Version:
文件分片上传 获取文件hash值 文件分片
29 lines (25 loc) • 626 B
Markdown
```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>
```
```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);
```