Make WordPress Core

Opened 2 years ago

Closed 8 months ago

Last modified 8 months ago

#19115 closed defect (bug) (invalid)

Attempting to upload a too-large theme gives a confusing error message

Reported by: ariehkovler Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.2.1
Component: Themes Keywords:
Focuses: Cc:


When uploading a theme through the theme uploader, if the theme is larger than the PHP file/memory limit, the Admin panel gives the message below (or some variant):

The uploaded file could not be moved to /public_html/wp-content/uploads/2011/11

Users will assume that this is a permissions problem, trying to CHMOD folders to fix it unsuccesfully, weakening security, when it is actually a file-size problem.

The correct error message should be:

"This file is too big. The maximum upload size for your server is xM."

I have been able to replicate.

Change History (4)

comment:1 csixty42 years ago

Seems to be fixed in 3.3

comment:2 kurtpayne2 years ago

  • Cc kpayne@… added
  • Keywords close added; needs-patch removed

This seems to be a failure from move_uploaded_file() not a failed upload due to any sort of upload / memory limits. When a file is uploaded, it is first uploaded to a temporary folder / name (e.g. /tmp/upload1234) then the php app (in this case WordPress) has to move the file to the desired location (e.g. /var/www/html/wp-content/uploads/...). This step is failing for some reason.

Check the notes on the php page for move_uploaded_file for tips on how to troubleshoot this on your server.

The error message is accurate.

comment:3 c3mdigital8 months ago

  • Resolution set to invalid
  • Status changed from new to closed

close keyword added over a year ago.

comment:4 DrewAPicture8 months ago

  • Keywords close removed
  • Milestone Awaiting Review deleted

After taking a closer look, to return a more "themey" error, we'd have to pass context through wp_handle_upload(). Currently, the value of $_FILES['themezip'] when really, that key is the last point-of-context.

Note: See TracTickets for help on using tickets.