How to Fix the HTTP File Upload Error in WordPress?
How to Fix the HTTP File Upload Error in WordPress?
How to Fix the HTTP File Upload Error in WordPress?

How to Fix the HTTP File Upload Error in WordPress?

How to Fix the HTTP File Upload Error in WordPress?
Today, I encountered an HTTP error when uploading file (a pdf) to WordPress website. While editing a post or page, on clicking ‘Add Media’, the file seems to upload as the progress bar progresses but after a while WordPress shows HTTP error. In this post, I would like to share how I resolved or fixed the HTTP File Upload Error in WordPress.

The HTTP error on file upload:

wordpress+upload+error

After a slight Google search, I also tried the solution to add a line in .htaccess as per this post How to Fix the HTTP Image Upload Error in WordPress but it did not work in my case. As per the post, the solution is to add the line ” SetEnv MAGICK_THREAD_LIMIT 1″ in the .htaccess file.

Steps to add the line ” SetEnv MAGICK_THREAD_LIMIT 1″ in the .htaccess file:

  •     Log into the website control panel dashboard (cpanel, plesk etc.)
  •     Using the file manager, navigate to the WordPress site’s root directory.
  •     Locate and open the .htaccess file for editing.
  •     Add the following line of code at the top of the file:   SetEnv MAGICK_THREAD_LIMIT 1
  •     Save the changes to the .htaccess file.

After editing the .htacess file, the HTTP error should not occur. However, even after applying the above solution, it did not work in my case. So reverted changes made.

After exploring some plugins, the HTTP Error on file upload was resolved after disabling automatic smush images on upload in the WP SMUSH plugin settings. Though the HTTP error also occured on upload of pdf or doc files, I am not sure why the WP SMUSH which actually applies to images resolved the HTTP error on upload for PDFs and ther files too.

  • At Plugins > WP SMUSH > Settings
  • Automatic Smush
  • Disable automatically smush my images on upload
  • Update Settings
http_error_file_upload_wordpress+wpsmush+plugin

After disabling automatic smush of images on upload, the HTTP error on upload was resolved. Tested with an upload of a PDF file and it worked.

If you are also facing the HTTP error on upload issue in WordPress and you have WP SMUSH plugin installed, then you can also try disabling the automatic smush on upload and try if it works for you