This error message can appear due to incorrect permissions, ownerships, or location of the WordPress uploads folder. Regardless of the cause, we’re here to show you how to fix this error quickly.
When facing this error message, we have been successful with fixing by making a simple change to the wp-config.php file.
1. Access your hosting file manager or FTP, and search for the wp-config.php file. It is commonly located in the root folder of your website (/public_html or /html).
2. Open the file and add the following code:
define( 'UPLOADS', 'wp-content/uploads' );
before this line:
require_once(ABSPATH . 'wp-settings.php');
3. Save the file. Now, try to upload your media files again.