This is the most recent error i have found after upgrade to wordpress 2.5. WordPress 2.5 uses extremely new way to handle images but most of user found problem in image upload due to apache mod_security module. The file responsible for image upload is async-upload.php in wp-admin folder. you may encounter following error message while uploading images to wordpress;

  • HTTP error
  • An error occurred in the upload. Please try again later.

Wordpress Image Upload Error Fix

This is the default message for image upload error. It should be more description and problem oriented so that user can determine problem easily. However most of the wordpress user face this error due apache mod_security filter enable for the website. To fix the problem you need to turn off apache mod_security filter for the async-upload.php file. The fix is very simple, you just need to update .htaccess for this.

Soution:

  1. 1) Use any free ftp program or you control panel file manager to download special file called .htaccess
  2. Edit file in your favourite text editor.
  3. You will find following content in file if you havn’t applied any custom htaccess rules.

    Options All -Indexes
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L] </IfModule>

  4. Add following line at the end of the file. Don’t worry if you have not above content in file or you didn’t find file at your host root. Create new file .htaccess with the below content.

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

  5. Now, your file content will look like this..

    Options All -Indexes
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L] </IfModule>
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

  6. Just save file and re-upload at the root of your website folder.
  7. All done.. Now error must be gone..

Written by Bala Krishna

Bala Krishna is web developer and occasional blogger from Bhopal, MP, India. He like to share idea, issue he face while working with the code.

This article has 1 comments