1

I know that if we are adding a new media in the month of August, it will be uploaded to /08 folder under /uploads.

But here i am facing a new issue. I wrote a page in the month of June(6th month). Today, that is in August I am trying to upload a new image to that page by clicking "Add media" button. I get the media uploader popup. I can select the file and click on upload. Then what happens is that the uploader shows this error message:

"The uploaded file could not be moved to /var/www/vhosts/*******.com/httpdocs/wp-content/uploads/2013/06"

Why it is trying to move to the path /06 when i am trying to upload the file in the month of August. Also, why is the uploading failing?

2 Answers 2

2

When you uploaded an image within the Edit Page screen for a page with a date of 06/01/2013, the media uploader will use the date of the page to set the sub-directory within the uploads folder.

This is expected behavior because the media uploader passes the post_date to the wp_upload_dir() function. See http://codex.wordpress.org/Function_Reference/wp_upload_dir#Important_Note

If you were to upload the image using just the media uploader, but NOT within a page or post, the file would be moved into the appropriate folder for the current date.

Check the permissions on the uploads folder and the 06 sub-folder. The uploads folder and included sub-folders should be set to 755.

1
  • Thanks a lot Rachel. You answered my question right to the point! Keep up the good work :) Aug 7, 2013 at 18:10
0

The date used to store the file is taken from the post you are attaching it to, not the current date.

The error message probably indicates that, for some reason, the permissions have changed on your uploads folder (at least for June). See the codex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.