Works with any backend npm install Zero dependencies

Single File Upload

Restrict the uploader to one file at a time. Selecting another file replaces the previous one.

(function() {
 new MultipleUpload('#demo', {
 uploadUrl: '/api/upload',
 multiple: false,
 autoUpload: true
 });
})();

The default, spelled out

multiple is false by default, so this is what the component does with no configuration at all: one file at a time. Picking a second file replaces the first rather than adding to it, which is the behaviour you want for an avatar, a profile document, or a replace-this-attachment control.

Why it is written out here

Setting multiple: false explicitly, even though it is the default, is worth doing in real code. Someone reading your configuration should not have to know the defaults to understand the intent — and a single-file uploader that only behaves that way by omission is easy to break by accident later.