Upload error: File too large (LIMIT_FILE_SIZE / file exceeds maximum upload size)
The uploaded file is larger than the limit set by the API, framework or server.
File too largeexceeds the maximum upload sizemay not be greater thanMulterError: File too largefile size limit exceeded Meaning
Limits exist at several layers: the app (Multer LIMIT_FILE_SIZE “File too large”, Laravel “may not be greater than 2048 kilobytes”), the language runtime (PHP upload_max_filesize / post_max_size), the web server (Nginx client_max_body_size → 413) and the provider (S3 single PUT 5 GB, many APIs 10–100 MB).
The smallest limit wins, so raising one layer isn’t enough if another is lower.
Common causes
- File genuinely above the documented limit
- Framework limit lower than the server limit (or vice versa)
- Multipart overhead or base64 encoding (+33%) pushes it over
- Proxy/CDN limit in front of the app
⚡ Quick fix
- Compress or resize before uploading
- Use the provider’s multipart/chunked or resumable upload for large files
- Raise the limit at every layer you control (app, PHP, web server, proxy)
Detailed fix by platform
Node.js
const upload = multer({ limits: { fileSize: 20 * 1024 * 1024 } }); // 20 MB
PHP
- php
; php.ini upload_max_filesize = 20M post_max_size = 25M
Nginx
client_max_body_size 25m;
How to diagnose
- Size — Actual file and request size
- Layers — App, runtime, web server, proxy limits
- Encoding — Is the file base64-encoded in JSON?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in API
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 14 Oct 2026