WordPress Trac: Ticket #19115: Attempting to upload a too-large theme gives a confusing error messagehttps://core.trac.wordpress.org/ticket/19115
<p>
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):
</p>
<pre class="wiki">The uploaded file could not be moved to /public_html/wp-content/uploads/2011/11
</pre><p>
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.
</p>
<p>
The correct error message should be:
</p>
<pre class="wiki">"This file is too big. The maximum upload size for your server is xM."
</pre><p>
I have been able to replicate.
</p>
en-usWordPress Trachttps://core.trac.wordpress.org/chrome/site/your_project_logo.pnghttps://core.trac.wordpress.org/ticket/19115
Trac 1.0.1csixty4Tue, 13 Dec 2011 06:45:53 GMThttps://core.trac.wordpress.org/ticket/19115#comment:1
https://core.trac.wordpress.org/ticket/19115#comment:1
<p>
Seems to be fixed in 3.3
</p>
TicketkurtpayneTue, 13 Dec 2011 15:30:07 GMTkeywords changed; cc sethttps://core.trac.wordpress.org/ticket/19115#comment:2
https://core.trac.wordpress.org/ticket/19115#comment:2
<ul>
<li><strong>cc</strong>
<em>kpayne@…</em> added
</li>
<li><strong>keywords</strong>
<em>close</em> added; <em>needs-patch</em> removed
</li>
</ul>
<p>
This seems to be a failure from <a class="ext-link" href="http://us2.php.net/move_uploaded_file"><span class="icon">​</span>move_uploaded_file()</a> 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.
</p>
<p>
Check the notes on the php page for move_uploaded_file for tips on how to troubleshoot this on your server.
</p>
<p>
The error message is accurate.
</p>
Ticketc3mdigitalMon, 12 Aug 2013 22:39:35 GMTstatus changed; resolution sethttps://core.trac.wordpress.org/ticket/19115#comment:3
https://core.trac.wordpress.org/ticket/19115#comment:3
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>invalid</em>
</li>
</ul>
<p>
close keyword added over a year ago.
</p>
TicketDrewAPictureTue, 13 Aug 2013 00:15:23 GMTkeywords, milestone deletedhttps://core.trac.wordpress.org/ticket/19115#comment:4
https://core.trac.wordpress.org/ticket/19115#comment:4
<ul>
<li><strong>keywords</strong>
<em>close</em> removed
</li>
<li><strong>milestone</strong>
<em>Awaiting Review</em> deleted
</li>
</ul>
<p>
After taking a closer look, to return a more "themey" error, we'd have to pass context through <tt>wp_handle_upload()</tt>. Currently, the value of <tt>$_FILES['themezip']</tt> when really, that key is the last point-of-context.
</p>
Ticket