inputHandler(e) {
let size = 1024*4;
let files_ = e.target.files[0];
let pice = Math.ceil(files_.size / size);
for (let index = 0; index < pice; index++) {
// 创建读取文件对象
let read = new FileReader();
let start = index * size;
let end = Math.min(start + size, files_.size);
let file = files_.slice(start, end);
//分片数据...
read.readAsDataURL(file);
read.onload = (e) => {
this.src.push(e.target.result);
};
}
}
文件分片实现
最新推荐文章于 2024-08-30 11:12:09 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)