I just fixed a similar error on a site (4.2.4), if your website is installed in a sub directory (like https://www.example.com/blog, or https://www.example.com/store instead of https://www.example.com) you may need to specify a path for “upload_url_path” in the table “wp_options”.
First it would be best to check the permissions like Stephan Griesel suggested.