Works with any backend npm install Zero dependencies

Combined Validation

All validations combined: allowed extensions, max file size, max file count, MIME type check, no duplicates, and no spaces in file names.

Drag & drop files here
<div id="myUploader" class="mu-uploader">...</div>
<div id="errors"></div>
var addedNames = {};
var uploader = new MultipleUpload(document.getElementById('myUploader'), {
 uploadUrl: '/api/upload',
 allowedExtensions: ['jpg', 'png', 'gif', 'pdf'],
 maxFileSize: 5 * 1024 * 1024,
 maxFiles: 5,
 onSelect: function(file) {
 // No spaces in name
 if (/\s/.test(file.name)) {
 showError(file.name + ': spaces not allowed in file name.');
 return false;
 }
 // No duplicates
 if (addedNames[file.name]) {
 showError(file.name + ': already added.');
 return false;
 }
 addedNames[file.name] = true;
 return true;
 },
 onRemove: function(file) { delete addedNames[file.name]; },
 onError: function(file, error) { showError((file ? file.name + ': ' : '') + error); }
});