HTTP Error Fix Can now upload large images

When uploading large images over an approximate size (~2500×2000) I was encountering the HTTP Error message when trying to crunch the image (which ultimately fails and doesn’t produce the smaller pre-defined image sizes).

After trying several solutions, the following appears to have solved it for my setup, once and for all – add this to your .htaccess file:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
php_value memory_limit "128M"
 
#BEGIN Image Upload HTTP Error Fix
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
<IfModule security_module>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
<IfModule security2_module>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
#END Image Upload HTTP Error Fix
view raw .htaccess This Gist brought to you by GitHub.

In short, it massively bumps up the allowed memory limit, and also tries to turn off some security aspects for the file that deals with the uploading, under different module setups.

Comments

  1. david says:

    REALLY WORKING – THANK YOU!!!

  2. Yee-Ha! I tried many many different approaches, this one finally worked! Thank you!

  3. I was using WordPress 3.4.1 version after upgrading 3.4.2 version i was facing the HTTP Error problem when tried to up load image and activating the plugin, editing the .htaccess file and so on didnt worked for me, problem sucked my 10 hours, this is a bug for 3.4.2 version, i uploaded the older version script 3.4.1 then it worked for me.

  4. yatra says:

    Showing 500 internal error while updating htacess.why?

    • Either you’ve copied and pasted incorrectly, caused some other grammatical error, or your server didn’t like the commands. Either way, I can’t help debug from the zero useful information you’ve given me.

      • i have edited my htaccess exactly above mentioned.But it show 500 internal error page when viewing the website. only watermark reload plugin makes this problem.when its inactive there is no problem.But i definitely need one watermark plugin.every watermark plugins shows the same error(when uploading images it shows http error)

        • It might be that your watermark plugin has attempted to add it’s own rules to the .htaccess file, and your replacing it with the code above has caused it to throw a 500 error.

          Maybe point the author of the plugin to this post, and see if they can spot anything in my code which they know will cause problems with their plugin functionality?

  5. I tried this code as well as many other codes but it is not working.

    • Maybe your host has disabled ceertain bits of code from working under .htaccess? If so, then your best bet is to raise it with them, tell them the solutions you’ve tried, and ask them to provide a fix instead.

Speak Your Mind

*