feat: fix upload component files show
parent
682b78cf79
commit
19d60765ab
|
|
@ -315,8 +315,11 @@ function uploadFileChunks(file, presignedUrls, checkpointId, groupName, url, api
|
||||||
};
|
};
|
||||||
|
|
||||||
xhr.upload.onprogress = function (event) {
|
xhr.upload.onprogress = function (event) {
|
||||||
const percentComplete = (event.loaded / event.total) * 100 / totalChunks + currentChunk/totalChunks;
|
// const percentComplete = (event.loaded / event.total) * 100 / totalChunks + currentChunk/totalChunks;
|
||||||
// console.log(`Upload progress: ${percentComplete.toFixed(2)}%`);
|
// console.log(`Upload progress: ${percentComplete.toFixed(2)}%`);
|
||||||
|
const bytesUploaded = currentChunk * chunkSize + event.loaded;
|
||||||
|
const totalBytes = fileSize;
|
||||||
|
const percentComplete = (bytesUploaded / totalBytes) * 100;
|
||||||
updatePercentProgress(`${percentComplete.toFixed(2)}%`);
|
updatePercentProgress(`${percentComplete.toFixed(2)}%`);
|
||||||
};
|
};
|
||||||
xhr.send(chunk);
|
xhr.send(chunk);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue