filesystem - WordPress HTTP Error on File upload

admin2025-06-06  2

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!

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!

Share Improve this question edited Mar 30, 2016 at 11:30 Stephen 1,3003 gold badges17 silver badges37 bronze badges asked Mar 30, 2016 at 10:51 Khairul AlamKhairul Alam 667 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 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.

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749147798a316773.html

最新回复(0)