MIME Type Validation
Validate files by MIME type using the onSelect callback. This demo only accepts image/* MIME types.
Drag & drop image files here
<div id="myUploader" class="mu-uploader">...</div>
var uploader = new MultipleUpload(document.getElementById('myUploader'), {
uploadUrl: '/api/upload',
onSelect: function(file) {
if (!file.type || !file.type.startsWith('image/')) {
document.getElementById('error').textContent =
file.name + ' is not an image file.';
return false;
}
return true;
}
});