Why this happens

PHP needs a working temporary directory to handle file uploads (including images and plugin installs) before moving them to their final location. If that temp directory isn't configured correctly on your server, or WordPress can't detect it automatically, uploads fail with this specific error even though nothing else appears to be wrong.

Step-by-step fix

  1. Add this line to wp-config.php: define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp/');
  2. Create a new folder named 'temp' inside the wp-content folder.
  3. Give that folder proper permissions (755, or mark it writable via File Manager).
  4. If the issue continues, ask your hosting provider to check the PHP upload_tmp_dir setting.

How to prevent it happening again