I received the following error when I try to upload the images to WordPress
“Create-purchase-order.png” has failed to upload.
Unable to create directory uploads/2021/05. Is its parent directory writable by the server?
This is a common issue with WordPress and there are several ways to fix this issue.
This error happens due to the file permission issue or the location of the upload directory. Now we will see how to fix this.
Now we will see how to specify the upload directory. You have to add the following line of code before the ABSPATH
in your wp-config.php
define( 'UPLOADS', 'wp-content/uploads' );
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
If you still get the error message after applying the changes stated on method 1, then you have to change the file permission of the upload directory.
Uploads folder and sub directories need 755
file permission