Human-Readable Size Options
Pass size values as strings like "10MB" or "2GB" instead of raw byte numbers.
(function() {
new MultipleUpload('#demo', {
uploadUrl: '/api/upload',
multiple: true,
maxFileSize: '10MB',
minFileSize: '1KB',
chunkSize: '2MB',
chunked: true
});
})();
Sizes you can read at a glance
Size options accept a string as well as a number, so '10MB' is equivalent to 10485760. The parser understands B, KB, MB, GB and TB, case-insensitively, with or without a space, and takes decimals — '1.5GB' is fine.
What the defaults are, and what an unparseable value does
maxFileSize defaults to -1, which means no limit, and minFileSize to 0. A string the parser cannot make sense of falls back to parseFloat and then to -1, so a typo like '10 megs' quietly becomes “no limit” rather than throwing. Worth knowing, because the failure is a limit that never fires rather than an error you would notice.