优化分片上传

pull/305/MERGE
Karson 2021-06-04 15:21:28 +08:00
parent 8130a49fab
commit bba702bd18
1 changed files with 1 additions and 5 deletions

View File

@ -252,11 +252,7 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined,
},
uploadprogress: function (file, progress, bytesSent) {
if (file.upload.chunked) {
var totalBytesSent = 0;
file.upload.chunks.forEach(function (item) {
totalBytesSent += item.bytesSent;
});
$(this.element).prop("disabled", true).html("<i class='fa fa-upload'></i> " + __('Upload') + Math.floor((totalBytesSent / file.size) * 100) + "%");
$(this.element).prop("disabled", true).html("<i class='fa fa-upload'></i> " + __('Upload') + Math.floor((file.upload.bytesSent / file.size) * 100) + "%");
}
},
totaluploadprogress: function (progress, bytesSent) {