Works with any backend npm install Zero dependencies

Prevent Duplicates

Block the same file (by name + size) from being added twice.

(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,
 autoUpload: false,
 preventDuplicates: true,
 onValidationError: function(msg, name) { log((name||'file') + ': ' + msg); }
 });
})();

Catching the same file twice

preventDuplicates defaults to false. Turned on, a file matching one already in the queue — or already uploaded in this session — is refused. It catches the common accident of selecting a folder, then selecting it again because the first attempt was not obviously working.

What counts as the same file

The comparison is name plus size, not content. Two genuinely different files that happen to share both will be treated as duplicates, and the same image saved under two names will not be. If real content identity matters, that is what computeHash and instant-upload dedupe are for.

detectDuplicates and enableDuplicateCheck are legacy aliases, applied only when preventDuplicates itself is absent.