Chunk Events Console
Trace every chunk-level event: start, complete, retry, and assembly.
(function() {
var logEl = document.getElementById('log');
function log(m) { var d = document.createElement('div'); d.className='pkg-log-entry'; d.textContent=m; logEl.appendChild(d); logEl.scrollTop=logEl.scrollHeight; }
new MultipleUpload('#demo', {
uploadUrl: '/api/upload',
multiple: true,
chunked: true,
chunkSize: '512KB',
chunkConcurrency: 2,
onChunkComplete: function(file, idx, total) {
log('Chunk ' + (idx+1) + '/' + total + ' done for ' + file.name);
},
onRetry: function(file, idx, attempt) {
log('Retrying chunk ' + idx + ' (attempt ' + attempt + ') for ' + file.name);
},
onTaskComplete: function(task, result) {
log('Assembly complete: ' + task.fileName + ' -> ' + (result.fileGuid || 'ok'));
},
onTaskError: function(task, err) {
log('FAILED: ' + task.fileName + ' - ' + err);
}
});
})();Following a large upload chunk by chunk
onChunkComplete defaults to null and fires as each chunk is acknowledged. For a multi-gigabyte file it is a far better health signal than the percentage: chunks arriving means the transfer is genuinely moving, where a static percentage could equally be a stalled request.
Order is not guaranteed
With chunkConcurrency above 1 several chunks are in flight at once and acknowledgements arrive out of order, so a count of completed chunks is not a count of contiguous bytes. Use it as a liveness and progress-count signal, and take the actual percentage from the task.