1

I have increased the max_file_upload_size from 20 MB to 100 MB in WordPress, but I've been facing a problem since then.

Whenever I try to upload a file of any type, it says "HTTP Error" when I use the multiple file uploader. I've tried to upload using the single file uploader. It says "Error saving media attachment" in this case.

I've tried changing the permission of wp-content/uploads folder to 755 and 744 but neither worked. Any idea how I can solve this issue?

Thanks!

1

I faced the same problem with my WordPress site. It's some bug in WordPress. Which version you are using?

I resolved this error by adding a function to my functions.php file in my theme.

function ms_image_editor_default_to_gd( $editors ) {
    $gd_editor = 'WP_Image_Editor_GD';
    $editors = array_diff( $editors, array( $gd_editor ) );
    array_unshift( $editors, $gd_editor );
    return $editors;
}
add_filter( 'wp_image_editors', 'ms_image_editor_default_to_gd' );

This worked for me, the function will change the current default upload to GD.

Go to the editor in WordPress, find functions.php and add the above code to that file.

  • I'm not having trouble uploading image file. Image files are being uploaded perfectly, but other file uploads are failing. – Khairul Alam Mar 30 '16 at 12:47
1

In my case the cause was plugin All In One WP Security an its "Basic Firewall Settings". The above firewall features are applied via your .htaccess file and one if these features is "Limit file upload size (10MB)."

So to make upload of files larger then 10 MB working again you can do following:

1) Go to WP Security / Firewall / Basic firewall rules tab and uncheck "Enable Basic Firewall Protection". Then Save settings. This will disable all Basic firewall settings and this 10 MB upload limitation as well.

or

2) If you want to keep the basic firewall rules but remove only that limitation, you need to use “Custom Rules”. Go to WP Security / Firewall / Custom rules tab and check "Enable Custom .htaccess Rules:". Then put in the custom rules text area:

LimitRequestBody 64000000

That will allow approx. 64 MB uploads. Also make sure that “Place custom rules at the top” checkbox is NOT checked, so it overwrites the 10M limit from above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.