Here’s a foolproof method to fix the dreaded HTTP error seen when attempting to upload images, videos, or other accepted file types to the WordPress Media Library.
One of the most frustrating aspects of using the popular WordPress platform is running into this error when attempting to upload media. If you’ve never experienced this, you’re lucky! I run into this problem on ~1% of my image uploads and have wasted a lot of time and energy trying to resolve it.
I’m not alone. The two million plus hits returned by a quick Google search for the cause of this problem make it abundantly clear that this problem is common, and that there is neither a simple explanation why it occurs nor a single solution that prevents it from happening. Here is a summary of some of the “solutions” that have been proposed:
- Reduce image size
- Increase PHP memory
- Disable mod_security
- Disable plugins
- Change php.ini and /or .htaccess settings
- Install a newer version of php
- Disable image optimization
- Change upload folder permissions
I’m not denying that these approaches work under some circumstances, and if you are consistently unable to successfully upload images to the WordPress media library you should probably investigate them. But be prepared for a lot of messing about with no guarantee of success. (At least, that was my experience.)
So, here’s a solution that works (note: except for websites hosted at wordpress.com, because plugins cannot be added to such sites).
How to avoid an HTTP error when uploading media to WordPress
Begin with these three one-time-only steps:
- Obtain and set up an FTP program so you can transfer files to your WordPress host. If you didn’t understand that sentence, don’t worry: here’s a beginner’s guide to obtaining an FTP program and using FTP to transfer files to and from your WordPress site.
- Install the Add From Server plugin and activate it. If you don’t know how to install a WordPress plugin, consult this clear beginner’s guide.
- From your WordPress Dashboard, check Settings > Add From Server. The default settings [User Access Control All users with the ability to upload files] & [Root Directory Do not lock browsing to a specific directory] should be fine for general use.
Once you’ve completed the above steps, you can upload media to your WordPress library as follows:
- Run your FTP program and navigate to the appropriate folder to upload your media. There are a couple of possibilities here. For a default WordPress installation, the appropriate folder will be your Uploads folder, i.e. (..[NameOfYourSite]/wp-content/Uploads/).
- If, however, you have the WordPress Dashboard Settings > Media option Organize my uploads into month- and year-based folders checked, you will probably want to upload your media into a subfolder of Uploads that has the form [CurrentFourDigitYear/CurrentTwoDigitMonth/], for example ..[NameOfYourSite]/wp-content/Uploads/2017/07/. Note that if this is your first upload for the current month, the folder won’t exist and you’ll need to create it using the FTP program.
- From your WordPress Dashboard, go to Media > Add From Server.
- Use the navigation links at the top of the Add From Server screen to navigate to the same folder you chose in step 1 or 2.
- Click the checkmark box (or boxes) next to the media you wish to add. Then scroll to the bottom of the page. There’s an option to set the imported date to the current date and time [default] or the file’s creation date and time. I think the default is most appropriate, but feel free to choose the alternative. Click the Import button and voila! Your selection(s) will be added to your WordPress Media Library!
That’s it! Although this description of the process is long, once you’ve set up your FTP program the five steps above take very little time to complete. I hope this has been helpful, and welcome your comments below!