UPLOAD_ERR_INI_SIZE 🐘 PHP

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

  1. Raise upload_max_filesize and post_max_size (post ≥ upload)
  2. Check $_FILES['f']['error'] and show a friendly message
  3. Make sure the temp dir exists and is writable

Detailed fix by platform

PHP

  1. upload_max_filesize = 50M and post_max_size = 55M in php.ini or .user.ini

How to diagnose

  1. Code — Value of $_FILES[...]['error']
  2. 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.