When uploading an image to the media library, you may get an HTTP error or 0 file size, or notice the image is never set or appears broken.

The Solution

This is usually due to one of the following:

  • The image you are uploading is too large
  • Your connection is timing out before the file is received on your server (slow internet, server issues etc)
  • The permissions set on your uploads folder or a security plugin is preventing the uploads from saving
  • You deleted the original and are trying to replace it, and caching is preventing the new image from being set.

Verify your images

Ensure images you upload are less than 2MB in file size. This ensures the image can be transferred at adequate speed over most internet connections both from you and to your visitors, and complies with most server upload limits set in WordPress

Turn off caching

If you have caching enabled via a plugin, clear the cache and then temporarily deactivate the plugin, then try again.

If you have a security plugin installed that changes your .htaccess rules, reset or restore your original .htaccess, temporarily deactivate the plugin and try again.

Some hosts offer these services server-side, such as Dreamhost’s Enhanced Security and Cloudflare. If you know these are enabled, try disabling them temporarily, wait at least 10 minutes, then try again.

Verify your server permissions

  1. Connect to your site with an FTP client
  2. Ensure your wp-content/uploads folder is 755 or 777 and all sub-directories are the same.