Getting files from users.
WHAT TO ESTABLISH
What types are permitted What size is permitted Whether several may be selected
WHAT TO TELL THE USER BEFORE THEY CHOOSE
Both of those limits.
WHY
Discovering a limit after a slow upload is infuriating.
WHAT TO SHOW DURING UPLOAD
Progress, genuinely.
WHY
Uploads are slow on mobile connections, and a stationary interface appears broken.
WHAT TO ALLOW
Cancellation.
WHAT TO HANDLE
Failure partway Connection loss Files exceeding limits Wrong file types
WHAT TO DO ABOUT LARGE FILES
Consider uploading in parts, so a failure does not restart everything.
WHY THAT MATTERS HERE
Connections drop, and a failed large upload wastes both time and data.
WHAT TO DO IN THE BROWSER WITH IMAGES
Consider resizing before uploading.
WHY
It reduces transfer substantially, which the visitor pays for.
WHAT TO NEVER TRUST
The reported file type or size.
WHY
Both are supplied by the client and can be altered. The server must verify.