WordPress file permissions for uploading media
Having trouble and getting errors when trying to upload your first image or media file into your WordPress blog post? I was!
I am currently running WordPress 3.1 and it is a fresh install with no modifications as yet, and was getting the following error message when trying to upload an image into my post for the first time:
Unable to create directory /home/name/public_html/wp-content/uploads/2011/03. Is its parent directory writable by the server?
So I set about finding a solution on Google and trying out a few suggestions from the WordPress forum post entitled Unable to upload images to blog posts. In this post it was suggested to manually set up the folders it was looking within the wp-content folder via FTP, and change the file permissions of the new uploads folder to 777.
So I created uploads/2011/03 and uploads/2011/03. within the wp-content folder as suggested and went into the folder permissions and changed the folder permission settings to 777.
I then tried to upload my image again into my post and was presented with the following error message:
“The uploaded file could not be moved to /home/name/public_html/blog/wp-content/uploads/2011/03.”
I went back to my search results and tried a few more suggestions, until I decided to delete the sub-folders in my new uploads folder and try to upload an image again, and success!
So after all that, it would seem all I needed to do was to create an uploads folder within wp-content (as below) with folder permissions set to 777.
I have also tried uploading images with the folder permissions of the uploads and wp-content folders set to 755 and this works fine too. So I would suggest not using 777 and set both these folder permissions to 755, as suggested in WordPress forum post unable to upload image.
If you want to read more about file permissions and changing them for WordPress, I suggest reading Changing File Permissions on WordPress.org.
I hope this helps