PHP upload error 1: The uploaded file exceeds the upload_max_filesize directive in php.ini
The uploaded file is bigger than PHP’s upload_max_filesize, so PHP discarded it.
Seen on:
PHP
Meaning
$_FILES['f']['error'] holds a code: 1 = over upload_max_filesize, 2 = over the form’s MAX_FILE_SIZE, 3 = partial, 4 = no file, 6 = no temp dir, 7 = can’t write to disk. If the whole POST exceeds post_max_size, $_FILES and $_POST are simply empty.
Common causes
- upload_max_filesize too small (default 2M)
- post_max_size smaller than the upload
- Missing/unwritable upload_tmp_dir (codes 6/7)
⚡ Quick fix
- Raise upload_max_filesize and post_max_size (post ≥ upload)
- Check
$_FILES['f']['error']and show a friendly message - Make sure the temp dir exists and is writable
Detailed fix by platform
PHP
upload_max_filesize = 50Mandpost_max_size = 55Min php.ini or .user.ini
How to diagnose
- Code — Value of $_FILES[...]['error']
- Limits — phpinfo() upload/post limits
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026