3.0.0 • Published 2 years ago

file-fragment-upload v3.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago
使用组件
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);