While uploading images to the media library, sometimes an unexpected HTTP error might crop up. This could throw a spanner in your plans to write an engaging blog post.
Such HTTP upload errors are not very common in WordPress, but they can occur sometimes. Fortunately, the image upload errors in WordPress can be fixed quite easily using one of the 9 methods I have described in this post.
You can also check out solutions to the other common WordPress errors that you could experience sometimes.
So let’s dive in.
1. Image Upload Errors Due to Incorrect File Permissions
The most common reason for the image upload error is incorrect file permissions of the Uploads folder in WordPress.
To rectify this, you should navigate to the directory in which WordPress is installed. You can use either the File Manager in your hosting panel or an SFTP program like FileZilla for this.
Here you can see the wp-content folder within which is the Uploads folder. Right-click the folder name to access the ‘File attributes’ or ‘File permissions’.
Within the File Attributes, you should set the permissions to 755. Select the check box next to ‘Recurse into subdirectories‘ and ‘Apply to directories only‘.
Now try uploading the image to your media library.
If you still cannot upload images, again open the File Attributes or Permissions of the Uploads folder in your WordPress installation. Now set the file permissions to 644, and select the check box next to ‘Recurse into subdirectories‘ and ‘Apply to files only‘.
Did this solve your HTTP image upload issue? If not, continue to the next solution below.
2. Try Browser Upload
The problem could also lie with the default WordPress media file uploader. To get around this problem, click the ‘browser uploader’ link in the Upload New Media panel of your WordPress dashboard.
Now try uploading the image. If the image was uploaded, it was a problem with the default file uploader. If you still face the image uploading error, try out the next fix.
3. Check the Image Dimensions
Did you know that WordPress sets a maximum image dimension for uploads? If you try uploading images larger than the maximum image dimension, it could result in an image upload error.
First, you should check out the maximum image dimensions allowed. To do this, go to Settings > Media.
Here you can see the dimensions in pixels for Large-sized media.
If the image you’re trying to upload exceeds this dimension, it could throw an error.
So, you should first resize your image using a free program like Paint for Windows or Paintbrush for Mac before uploading it in WordPress.
4. Increase the upload file size limit
WordPress displays the maximum file size limit for uploads, as set by your hosting provider.
For instance, Dreamhost allows a maximum file upload size of 512 MB. If the limit is less, say 10 MB, and you are trying to upload a larger-sized file, you can increase the upload limit using these methods.
1 .htaccess method
In the root WordPress installation directory, look for the .htaccess file. Now enter the following lines in this file and save:
php_value upload_max_filesize 64M php_value post_max_size 128M php_value memory_limit 256M php_value max_execution_time 300 php_value max_input_time 300
2. functions.php method
Go to Appearance > Theme Editor and edit the functions.php (Theme Functions) file. Enter the following snippet:
@ini_set('upload_max_size', '64M'); @ini_set('post_max_size', '64M'); @ini_set('max_execution_time', '300');
But if you use this method, then you should remember that these settings will return to the default if you change your theme. In this case, you will need to again edit and update your functions.php file.
3. php.ini method
You can also edit the php.ini file in your root WordPress installation to increase the maximum file size limit. If this file is not present, you can create a file named php.ini (which is a settings file) and upload it in your parent WordPress directory.
The following snippet should go in the php.ini file that you’re editing or creating.
upload_max_filesize = 25M post_max_size = 13M memory_limit = 15M
If none of the three methods work, then you should contact your hosting provider to increase the file upload limit.
5. Unsupported File Type
The HTTP image upload error could also result due to an unsupported file type.
By default, WordPress only allows for certain types of files for security reasons. The common file formats include:
- Images like .png, .gif, .jpg
- Documents such as .doc, .xls, .ppt, .pdf
- Audio like .wav, .mp3, .mp4
- Video like .mpg, .mov, .wmv
So, you should make sure that you are uploading a file type that is supported by WordPress.
You should also check the name of the file to ensure that is in the correct format.
For instance, an image file with the name xyz.png.webp may result in an uploading error. The correct name should be xyz.png.
6. Insufficient PHP Memory
WordPress requires sufficient PHP memory to work correctly. The recommended PHP memory is 256 MB. If your hosting provider has set a lower memory limit, it might cause HTTP image uploading errors.
Before increasing the PHP memory limit, you should first check the current maximum limit. To do this navigate to the Site Health dashboard in WordPress by going to Tools > Site Health
Click the Info tab and then click the Server dropdown.
Here you can see various information related to your server. But we are interested in the max PHP memory limit.
If it is less than 256 MB, then add the following line to your wp-config.php file. This file is present in your root WordPress directory and can be accessed using your hosting panel’s File Manager or an SFTP program like FileZilla.
Notice that you can also check your maximum file upload size limit in the Info panel.
7. Outdated PHP Version
You can also check your PHP version in the Info tab of the Site Health dashboard. It is preferable to use the latest version of PHP (8.x) if supported by your web host.
If your site is running on a PHP version lower than 7.0 it could various issues including the image upload error.
In this case, you should head over to your hosting panel and check if you can upgrade your website to the latest PHP version or not.
Quality hosts like Dreamhost provide the option to upgrade to the latest PHP version in their hosting panel.
If you cannot upgrade your PHP version manually then contact your web hosting support to upgrade your PHP version for you.
Did this resolve the image upload error? If not, try out the next solution below.
8. Clear the Browser Cache
Sometimes, a simple trick like clearing the browser cache can solve such image upload errors. So go ahead and press CTRL+SHIFT+DELETE simultaneously to clear the cache.
9. Plugin Conflict
If clearing the browser cache also did not solve the uploading error, then maybe one of your plugins or themes is causing it.
So, go to your Plugins panel and deactivate all the plugins. Now activate each plugin one by one. Whenever you activate a plugin, you should try to upload the file to your media library. If you’re able to upload the file without any error means that a plugin conflict was the cause of the error.
You can try this out for your themes as well by switching over the default WordPress theme.
I hope you were able to resolve the HTTP image upload error using one of the 9 methods that I described here. However, if the error persists, please get in touch with your web host to rectify it for you.
Or you can order our tried and tested WordPress Error Fixing Service to get professional and timely help in fixing the image upload issue on your website.
Download the WordPress SEO eBook
Go from WordPress SEO Zero to Hero in no time. Also receive 2 Bonus PDFs with this free eBook.
Give it a try. You will thank yourself later.
- How to Add Google Fonts to WordPress With and Without Using a Plugin - October 17, 2021
- How to Easily Create a Child Theme in WordPress in Under 5 Minutes - October 14, 2021
- 10 Fixes to Speed Up a Slow WordPress Admin Dashboard - September 30, 2021