More fixes

WordPress will not upload a photo or file

You drag a photo into the Media Library and get one of these instead: "exceeds the maximum upload size for this site", "The uploaded file exceeds the upload_max_filesize directive in php.ini", a bare "HTTP error.", "Post-processing of the image failed", "Sorry, you are not allowed to upload this file type", or "Unable to create directory wp-content/uploads/... Is its parent directory writable by the server?". They look alike but each one names a different limit: the size the host allows, the server's memory for resizing photos, the file types WordPress accepts, or the uploads folder itself. Below is a rebuilt example (not a real client), then which message means what and how each gets fixed.

What the owner sees in Media, Add New

rosascornerbakery.example/wp-admin/media-new.php

What the checks found


  

Find out which kind it is (two minutes)

  1. Read the exact words. Each message below points at one limit. Copy it down before you retry, because a retry often shows a different, vaguer one.
  2. Look at the limit WordPress states. Media, Add New shows "Maximum upload file size: 2 MB" (or similar) under the drop box. Compare it with the file's size: right-click the file, Properties on Windows or Get Info on a Mac.
  3. Try a small file. Upload a tiny JPEG, such as a screenshot. If that works, the problem is this file's size, dimensions or type. If even that fails, the problem is the uploads folder, the disk space or the server.
  4. Note the file type. iPhone photos are often HEIC, design files are often SVG, and some cameras save WebP or TIFF. Not every site accepts all of them.

The fixes, by message

  1. "exceeds the maximum upload size for this site" or "exceeds the upload_max_filesize directive in php.ini". The file is bigger than the host allows. For photos the better fix is a smaller file: a phone photo is 4,000 to 6,000 pixels wide and 3 to 12 MB, while a website needs about 2,000 pixels and 200 to 600 KB (see the slow photos guide). For PDFs, videos or a theme zip, raise the limit in the host's PHP settings (cPanel: Select PHP Version, Options, or MultiPHP INI Editor): set upload_max_filesize to a little above your biggest file and post_max_size to the same or higher. Do not paste php_value lines into .htaccess from a tutorial: on many servers that takes the whole site down with a 500 error. On a multisite network there is a second cap in Network Admin, Settings, "Max upload file size".
  2. "HTTP error." or "Post-processing of the image failed". The file arrived, but the server ran out of memory or time while WordPress made the smaller copies of it. Reload the page and look in the Media Library first: the photo is often already there. Then resize big photos to about 2,000 pixels wide before uploading (WordPress itself suggests 2,500 at most). If small photos fail too, raise memory_limit as in the memory guide, switch off a security or image-compression plugin for one test upload, and, if it still fails, send the host the time of the upload: a server firewall rule (mod_security) can block uploads and only the host can see that.
  3. "Sorry, you are not allowed to upload this file type". WordPress refuses some types on purpose. HEIC from an iPhone: export or share it as JPEG, or set the phone to save JPEG (Settings, Camera, Formats, Most Compatible); recent WordPress versions accept HEIC only when the host's image library can read it. SVG: WordPress blocks it because an SVG can carry code; use PNG, or a plugin that cleans SVGs, never a snippet that simply allows them. A file renamed by hand, such as photo.png that is really a JPEG, is refused too: save it again in the right format.
  4. "Unable to create directory wp-content/uploads/... Is its parent directory writable by the server?" or "The uploaded file could not be moved". WordPress cannot write into the uploads folder. Check, in this order: disk space in the host panel (a full plan refuses every write); the folder permissions, with wp-content/uploads and the folders in it at 755 (not 777); after a site move, Settings, Media showing a "Store uploads in this folder" box with the old server's path, which should be emptied; and the folder's owner, which only the host can fix if files were copied in as the wrong user.
  5. "Missing a temporary folder". PHP has nowhere to put the file while it arrives. That folder belongs to the server, not to WordPress: send the host the message, it is theirs to fix.
  6. Test: upload one large phone photo, one PDF and one small image, check each shows in the Media Library and on a page, and look at the page on your phone.

What you see, what it means, what it needs

What you seeWhat it meansUsual fix
"exceeds the maximum upload size for this site"File bigger than the host's upload limitResize the photo; for other files raise upload_max_filesize and post_max_size in the host panel
"HTTP error." on a large photoServer ran out of memory or time making the resized copiesCheck the Library, then upload it at about 2,000 px wide
"Post-processing of the image failed"Same, said more plainly (WordPress 5.3 and later)Upload a smaller version; raise memory if small ones fail too
"not allowed to upload this file type"HEIC, SVG or a mislabelled fileSave as JPEG or PNG; SVG only through a cleaning plugin
"Unable to create directory ... writable"Uploads folder not writable, disk full, or an old folder pathDisk space, 755 permissions, empty the old path in Settings, Media
"Missing a temporary folder"Server's temporary folder missingThe host fixes it
Theme or plugin zip: "The link you followed has expired"The zip is over the upload limitSee the link expired guide

What not to do

Most upload errors are the first two rows of the table and are gone once photos are resized before upload. If small files fail too, or the host and WordPress each say the other is the problem, that is what the box below is for. Related: "allowed memory size exhausted" and photos that slow the site down.