Recently I was adding some images to a WordPress media library for a new post and I was greeted with the error message ‘Upload error – media failed to save to storage”, so off googling I went. Naturally I ended up at the WordPress codex and WordPress forums which pointed me in the general direction, but solutions offered didn’t fix my woes.
I worked my way through potential errors one at a time checking them off as I went:
- Odd characters in the file name – tested, altered, not the problem.
- Different file type – tried a .jpg instead of .png, not the problem.
- Plugins – turned off all plugins, not the problem… starting to get worried.
- Check uploads folder permissions with FTP app – yep, permissions set to 755, not the problem… apparently.
I found a few comments in the WordPress forums where people suggested changing the uploads folder permissions to 777, but I was a little nervous about basically reducing security to zero for that particular folder.
Try turning it off and then back on again
I thought I’d try changing the permissions for the uploads folder (and sub-folders) to 777, and then just change it straight back to 755 and it worked!
Seems like an odd quirk, but but it worked perfectly for fixing the media upload error. Go technology!
At the time of errors occurring the site was running WordPress 4.1.0 with 6 very popular plugins and hosted on a Media Temple Grid account.
(Update 1: a week later)
A week after posting this article the same error occurred, but this time the FTP folder permissions trick didn’t work. In this particular case, changing the first character of the file name from uppercase to lower case fixed the issue (e.g. Example.jpg to example.jpg).