I have an error says : The uploaded file could not be moved to wp-content/uploads/../..

Dear, friends.

I am using WordPress on Ubuntu 18.04 via DigitalOcean Apps Marketplace. PHP7.4 + Apache2 .

While tried to upload an image via WordPress media library, i have an error : “The uploaded file could not be moved to wp-content/uploads/2020/05

I have browse to some links and i tried this :


i typed ls -ld /var/www/html/wp-content/uploads/

And the result is drwxr-xr-x 5 www-data www-data 4096 Feb 11 04:13 /var/www/html/wp-content/uploads/

I need your help to fix this issue. Thank you.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @Technosatmedia,

This error is usually generated to invalid ownership or permissions. Most probably it’s permissions. To fix that, I’ll recommend running the following commands

find /path/to/website/wp-content -type f -exec chmod 644 {} \;

The above command will change every file’s permission to 644 which are the default. The next command will do the same for folders but with 755 permissions

find /path/to/website/wp-content -type d -exec chmod 755 {} \;

Lastly, to fix the ownership, run the following command in your droplet

chown -R www-data:www-data /path/to/website/wp-content

You should be able to upload files now without a problem.

Regards, KDSys