1
votes

I am having the problem while uploading the media file in wordpress. While uploading the media file instead of saving it to folder wp-content/uploads/2016/07/ it's uploading to the folder wp-content/uploads/2013/01 with the permission 644.

I have tried by changing the permission of the wp-content/ and uploads/ to 755 and 777 recursively as well. But no any progess.

PS: I am trying to upload the file from media of wordpress dashboard not from any post so that we call it a feature.

2

2 Answers

2
votes

1) Try printing the wp_upload_dir() function in one of your templates so you can see what's going on under the hood: <?php print_r(wp_upload_dir()); ?>

This output an array that looks something like this:

Array ( [path] => /root/of/site/wp-content/uploads/2016/07 [url] => http://whatever.com/wp-content/uploads/2016/07 [subdir] => /2016/07 [basedir] => /code/wp-content/uploads [baseurl] => http://whatever.com/wp-content/uploads [error] => )

2) If that path is wrong, you need to reset it. Check in your wp-config.php and see if you are redirecting the default download folder to something custom. Look for this line of code: define('UPLOADS', 'custom/path/here');

If you don't see this line of code, put it in there and set it to whatever you want.

3) You can override the behavior you are seeing with plugins. My favorite is called Custom Upload Dir: https://wordpress.org/plugins/custom-upload-dir/. Search around a bit, there are a number of similar plugins for you to try.

1
votes

Did you check your server's system date? Also did you correctly set the permissions for the owner and group of the web root before recursively setting the permissions of the directories and files therein?