Browser file upload limits are rarely determined by the browser alone. This reference separates browser behavior from server, proxy, and storage constraints, then gives you a practical compatibility checklist for desktop and mobile upload workflows.
Overview
There is no single, universal maximum file size imposed by HTML or the browser. A browser can usually expose a selected file through the File API, but the upload may still fail because of an application rule, reverse proxy limit, request timeout, object-storage policy, available memory, or mobile operating-system behavior. Treat the browser as one part of an upload path rather than the authority on the final limit.
The most reliable approach is to define the intended upload contract first. Record the accepted file types, maximum size per file, maximum number of files, whether folders are supported, whether uploads can be paused, and how errors are reported. Then test that contract in the browsers and devices your users actually use.
For large files, do not assume that a conventional multipart/form-data request is sufficient. A resumable design can split a file into chunks, retry failed parts, and preserve progress when connectivity changes. See the resumable file uploads guide for a workflow focused on chunking and recovery.
Browser behavior at a glance
| Capability | Desktop browsers | Mobile browsers | Implementation guidance |
|---|---|---|---|
| Maximum file size | No dependable browser-wide maximum; practical limits depend on APIs, memory, and the upload method. | More variable because of device memory, operating-system pickers, connectivity, and backgrounding. | Enforce size on the server and provide early client-side validation as a convenience. |
| Multiple-file selection | Generally available with multiple, subject to picker and application behavior. | Available in many environments, but selection UX and provider integration vary. | Test selection, removal, ordering, and partial failure behavior. |
| Directory selection | Often supported through non-standard or browser-specific directory attributes. | Support is less predictable and may depend on the file picker. | Make directory upload an enhancement, not the only path. |
| Drag and drop | Usually practical on pointer-based devices. | Usually irrelevant or unavailable as a primary interaction. | Always provide a visible file-picker control as the fallback. |
accept behavior | Can filter or guide picker choices, but does not validate file contents. | May influence available sources or apps differently across devices. | Validate extension, declared type, and file content on the server. |
| Progress and cancellation | Possible with upload-capable request APIs and suitable application logic. | More vulnerable to suspension, navigation, connectivity changes, and resource pressure. | Design for interruption and make the current state understandable. |
Checklist by scenario
Small form uploads
- Set a clear
acceptvalue for user guidance, such as image or document types. - Use
multipleonly when the interface can explain the count and total-size limits. - Show selected filenames, human-readable sizes, and a way to remove an item before submission.
- Validate the request again on the server. Client-side checks improve feedback but are not a security boundary.
- Return field-level errors that distinguish an unsupported type, excessive size, authentication problem, and temporary server failure.
Large files and unreliable connections
- Choose a resumable or chunked protocol when a failed request would otherwise require starting over.
- Define chunk size, retry limits, expiration, and how abandoned uploads are cleaned up.
- Track progress by bytes confirmed by the server, not only by bytes handed to the browser.
- Support cancellation and make it clear whether cancellation removes already uploaded temporary data.
- Test refreshes, sleep and wake cycles, network changes, expired sessions, and duplicate retry requests.
Multiple files or folders
- Decide whether limits apply per file, per selection, per user, or per upload session.
- Do not depend exclusively on directory selection. Include a standard file-selection route.
- Handle partial success explicitly: users should know which files completed and which need another attempt.
- Preserve relative paths only when the product needs them, and normalize them safely on the server.
- Test large selections for UI responsiveness, especially when previews or metadata are generated in the browser.
Images, media, and previews
Reading a file for a preview is separate from uploading it. Creating object URLs is generally more memory-efficient than converting every file to a large data URL, but object URLs should be released when they are no longer needed. Avoid decoding many full-resolution images simultaneously. If image dimensions or format conversion matter, enforce the final result on the server or processing service as well. The web image format reference can help document format choices and trade-offs.
What to double-check
Use feature detection, not browser-name assumptions
const input = document.querySelector('#files');
const supportsMultiple = 'multiple' in input;
const supportsFileApi = 'File' in window && 'Blob' in window;
const supportsDrop = 'ondrop' in document.createElement('div');
if (!supportsFileApi) {
// Show a compatible fallback or an explanation.
}
Feature detection should control optional behavior, while a tested browser-and-device matrix should control release decisions. The presence of an API does not guarantee that every file source, picker, or background scenario behaves identically.
Trace every limit in the request path
Write down the configured limit at each layer: the file input experience, client validation, application server, web server, reverse proxy, content delivery layer, object storage, malware scanner, and downstream processing job. A browser error may actually be an HTTP status, a connection reset, a timeout, or a storage rejection. Use browser developer tools and server logs together rather than changing the frontend limit blindly.
For multipart endpoints, verify the request method, boundary handling, content length behavior, timeout values, authentication lifetime, and CORS configuration. For direct-to-storage uploads, verify the signed request's expiration and the storage service's object-size and metadata rules. The file upload troubleshooting guide covers these failure categories in more detail.
Test MIME and filename assumptions
The accept attribute is a hint to the picker, not proof of a file's identity. Extensions can be changed, and the browser-reported MIME type may be empty or inconsistent. Compare the filename, declared type, and detected content where appropriate. Apply an allowlist, reject dangerous formats when they are not required, and store uploads outside executable web paths. Use the MIME types and file extensions reference when documenting accepted formats.
Common mistakes
- Calling a browser limit a platform limit: A browser may select a large file even though the server rejects the request. Name the failing layer precisely.
- Loading the entire file into memory: Avoid unnecessary
ArrayBuffer, data URL, or duplicate preview copies. Process in streams or chunks where the workflow allows. - Assuming mobile is desktop with a smaller screen: File providers, camera sources, app switching, permissions, and suspension can change the upload lifecycle.
- Trusting
acceptfor security: Treat it as interface guidance only; perform server-side validation and scanning. - Ignoring cancellation and retry races: A user can click retry while an earlier request is still finishing. Use upload identifiers and idempotent server operations.
- Testing only successful uploads: Include zero-byte files, duplicate names, unsupported content, interrupted connections, expired sessions, nearly full storage, and partial multi-file failures.
- Replacing the file control with a custom button that breaks keyboard access: Keep the native input usable by keyboard and assistive technology, and make status messages available to screen readers.
When to revisit
Review this reference before a seasonal planning cycle, a major browser or operating-system release, a framework upgrade, or any change to storage and proxy infrastructure. Revisit it when adding folder selection, camera capture, previews, resumable uploads, direct-to-storage transfers, or new mobile support.
Keep a small regression suite with representative files: an empty file, a file just below and above each configured limit, a large file, an unsupported extension, a misleading extension, duplicate filenames, and a multi-file selection. Run it on supported desktop browsers and at least one realistic device for each mobile platform. Record the browser version, operating system, network condition, file source, observed status code, and user-facing message.
Before release, confirm this final sequence:
- Document the product limits and accepted formats.
- Detect optional browser features and provide fallbacks.
- Validate early in the interface, then validate and secure on the server.
- Trace size, timeout, authentication, and storage limits across every infrastructure layer.
- Test interruption, retry, cancellation, accessibility, and mobile behavior.
- Update the compatibility notes when workflows, tools, or supported browsers change.
For API-level verification, compare browser results with controlled requests from cURL, Postman, or automated tests using the file upload API testing guide. This helps isolate frontend behavior from backend and infrastructure constraints.