We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// 构建Socket.IO Blob数据并请求,最后请求合并分片 async buildBlobData(chunkCount, file, hash, res) { const that = this; const blobData = []; for (let i = 0; i < chunkCount; i++) { if ( res.type == 0 || (res.type == 1 && res.index && res.index.length > 0 && !res.index.includes(i.toString())) ) { const start = i * that.chunkSize; const end = Math.min(file.size, start + that.chunkSize); const blobItem = Object.create({}); blobItem.file = blobSlice.call(file, start, end); blobItem.name = file.name; blobItem.total = chunkCount; blobItem.chunkSize = that.chunkSize; blobItem.index = i; blobItem.size = file.size; blobItem.hash = hash; blobData.push(blobItem); } } for (let item of blobData) { await that.socket.emit("upload", item); } },
The text was updated successfully, but these errors were encountered:
No branches or pull requests
// 构建Socket.IO Blob数据并请求,最后请求合并分片
async buildBlobData(chunkCount, file, hash, res) {
const that = this;
const blobData = [];
for (let i = 0; i < chunkCount; i++) {
if (
res.type == 0 ||
(res.type == 1 &&
res.index &&
res.index.length > 0 &&
!res.index.includes(i.toString()))
) {
const start = i * that.chunkSize;
const end = Math.min(file.size, start + that.chunkSize);
const blobItem = Object.create({});
blobItem.file = blobSlice.call(file, start, end);
blobItem.name = file.name;
blobItem.total = chunkCount;
blobItem.chunkSize = that.chunkSize;
blobItem.index = i;
blobItem.size = file.size;
blobItem.hash = hash;
blobData.push(blobItem);
}
}
for (let item of blobData) {
await that.socket.emit("upload", item);
}
},
The text was updated successfully, but these errors were encountered: