Last night, media upload worked just fine. This morning, it's suddenly broken. I have googled the problem and read through several similar cases. I have tweaked the permissions in FTP to everything between and including 744 and 777, but the error persists. I have also deactivated all the plugins, which did not solve the problem either.
I uploaded a picture to the folder manually (through FTP), it is not seen by the media library in the WP dashboard. I have also noticed that the already uploaded images in media library become unavailable unless the permissions of the upload folder is set to 777, which is a well known security issue.
How do I fix is so that I can upload images again and keep my images available with a safer permission setting?