Works with any backend npm install Zero dependencies

Max File Size

Limit individual file size with maxFileSize. This demo rejects files larger than 5 MB.

Drag & drop files here (max 5 MB each)
<div id="myUploader" class="mu-uploader">...</div>
var uploader = new MultipleUpload(document.getElementById('myUploader'), {
 uploadUrl: '/api/upload',
 maxFileSize: 5 * 1024 * 1024 // 5 MB in bytes
});

The ceiling

maxFileSize defaults to -1, which means no limit. It takes a number of bytes or a readable string such as '100MB', and files over the limit are rejected at selection rather than after a wait.

The limit that actually stops anything

This one is a courtesy to the user — it saves them uploading something you were going to refuse. The limit that protects your server is the one it applies while writing bytes, because a declared Content-Length is just a number the caller chose. Set both, and make the server's the authoritative one.

A string the parser cannot read falls back to -1, which is “no limit”. So a typo here fails open, silently.