Chunked Upload with Checksum
Compute a file hash before chunked upload and send it during assembly for integrity verification.
(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: '1MB',
computeHash: true,
hashAlgorithm: 'sha256',
onHashComputed: function(task, hash) {
log(task.fileName + ' SHA-256: ' + hash.slice(0, 24) + '...');
},
onTaskComplete: function(task) {
log(task.fileName + ' uploaded with verified checksum');
}
});
})();