# File Upload

File upload lets users transfer one or more local files to a product with explicit selection, constraints, progress, validation, and recovery.

- Type: practice
- Domain: Experience & interface
- Level: Intermediate
- Last reviewed: 2026-10-06
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/file-upload/>)

## What it means

A file-upload interface connects a file picker, and optionally drag and drop, to a transfer process. It communicates accepted file types, number and size limits, selected files, progress, success, errors, removal, and any later processing state. Selection and upload may occur immediately or as separate steps.

## Why it matters

Uploads cross device, browser, network, storage, security, and privacy boundaries. Clear constraints and recoverable progress prevent users from investing time in a transfer that the product cannot accept or safely process.

## When to use it

Request an upload only when the file is necessary and cannot reasonably be captured or reused another way. Use the native file picker as a reliable baseline, add drag and drop as an enhancement, and support camera or cloud sources when the audience and platform justify them.

## How it works

1. State why the file is needed and list accepted types, quantity, size, and content constraints before selection.
2. Use a labeled native input and optionally add a clearly identified drop area with equivalent picker access.
3. Show selected filename, size, progress, cancel or remove controls, and whether upload has started.
4. Validate on both client and server, preserve acceptable files, and explain how to fix each rejection.
5. Confirm successful transfer and processing, then test interruption, retry, duplicates, mobile sources, keyboard use, and privacy handling.

## A practical example

An insurance claim asks for up to five JPG, PNG, or PDF documents under 10 MB each. Users can choose or drop files, see per-file progress, retry only a failed transfer, remove the wrong file, and reuse a document already uploaded earlier in the claim.

## Where it breaks

Large transfers fail on unreliable networks, client-side checks cannot establish file safety, and format requirements may exclude users with limited tools. Uploading sensitive material creates retention, access, and deletion obligations beyond the component itself.

## Common mistakes

- Revealing size or type restrictions only after a long upload fails.
- Making drag and drop the only selection method.
- Showing upload completion when server-side processing is still pending.
- Clearing all accepted files because one file is invalid.

## Sources

1. [File upload](<https://design-system.service.gov.uk/components/file-upload/>) — GOV.UK Design System · Institutional design system
2. [File input](<https://designsystem.digital.gov/components/file-input/>) — U.S. Web Design System · Institutional design system

## Related topics

- [Drag and Drop](<https://wiki.soroush.uk/topic/drag-and-drop/>)
- [Form Validation](<https://wiki.soroush.uk/topic/form-validation/>)
- [Progress Indicator](<https://wiki.soroush.uk/topic/progress-indicator/>)
