DocumentationSize Limits

Size limits

You can optionally set a minimum and/or maximum file size, both specified in KB. Files outside the range are rejected as soon as they're dropped or selected. They still appear in attachedFiles (with status: "rejected" and a rejectionReason) so the user sees them flagged in the list, but they are never uploaded. The instructions shown to the user are written in whichever unit reads best for the value: maxFileSize={100} shows "Max: 100 KB", maxFileSize={2048} shows "Max: 2 MB".

<DropUpload
  minFileSize={512} // 0.5 MB
  maxFileSize={2048} // 2 MB
/>

Leave either prop unset (or 0, the default) to skip that bound. For example, only set maxFileSize for an upper limit with no minimum.

Size limits are enforced client-side, which helps the user pick the right files but can be bypassed. Always re-validate file size on your server too.