How to fix errors with uploading images or media in WordPress

If you are having trouble uploading images because of this error: File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini when you use either the flash uploader or the browser, there is fix. A short article by  Phillip Barron outlines a fix using the .htaccess file.


Step 1

Using your FTP open the root directory. Download .htaccess and open it with

text editor or notepad. It should be just below the folders. If there isn’t a .

htaccess file
, create one.

Step 2

Insert the following into your .htaccess file. If there is other commands which there most likely will be just under that is fine.

<IfModule mod_security.c>
SetEnvIfNoCase Content-Type
"^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>

<IfModule mod_gzip.c>
mod_gzip_on No
</IfModule>

Step 3

Save  and upload the .htaccess file back into the root directory overwriting the original.

Result: Image upload should be successfully using Firefox/Windows with no errors.

Related Posts

One Response to “How to fix errors with uploading images or media in WordPress”

  1. Aug 12th, 2010 :

    I really like what you post here, very refreshing and intelligent. One thing though, I’m running Firefox on Fedora and parts of your site structure are a little misaligned. I know it’s not a popular setup, but it’s still something to keep an eye on. Just tossing you a heads up.

Leave a Reply

Name (Required)

Email (Required - will not be published)

Website

Message (Required)