Min File Size
Enforce a minimum file size using the onSelect callback. This demo rejects files smaller than 1 KB.
Drag & drop files here (min 1 KB)
<div id="myUploader" class="mu-uploader">...</div> <div id="error"></div>
var uploader = new MultipleUpload(document.getElementById('myUploader'), {
uploadUrl: '/api/upload',
onSelect: function(file) {
if (file.size < 1024) {
document.getElementById('error').textContent =
file.name + ' is too small (min 1 KB).';
return false; // Reject the file
}
return true;
}
});
A floor, not just a ceiling
minFileSize defaults to 0 and accepts a readable string such as '1KB'. It rejects files that are suspiciously small before they are sent.
The failure it catches
Zero-byte and near-empty files are almost always an accident upstream: an export that failed, a capture that was interrupted, a placeholder a program wrote and never filled in. Accepting them means the problem surfaces much later, in whatever tries to process the file, where it is far harder to trace back to the upload.