Media Upload Problem (The uploaded file could not be moved to error)
-
Hi,
I have read several posts which seem to relate the issue I am having but on a brand new install (which is working as far as viewing and admin is concerned) I cannot upload files to the media library? This is on a VPS (Debian) box. I try to upload files and I get the following error:
The uploaded file could not be moved to /var/www/vhosts/myblogdomain/httpdocs/wp-content
None of the posts seem to have a concrete answer? Anyone know what is causing this and more importantly, what can be done to fix it?!
Thanks
Tony
-
Also check that the directory your files are being saved to before being moved is accessible under the open_basedir setting.
I had this issue where the open_basedir was set only to my hosting directory by my host provider, and the /tmp directory where the files are uploaded to initially needed to be accessible.
You can test this by writing or finding online a quick PHP upload script, turn on display_errors and check the error returned when you try uploading an image or file.
That doesn’t work either. My directories now look like this:
[myles@ldc873 nicole]$ ls -ld wp-content drwxr-xr-x 6 myles psacln 4096 Sep 9 02:08 wp-content [myles@ldc873 nicole]$ cd wp-content/ [myles@ldc873 wp-content]$ ls -l total 20 -rw-r--r-- 1 myles psacln 30 May 4 2007 index.php drwxr-xr-x 3 myles psacln 4096 Aug 11 20:47 plugins drwxr-xr-x 4 myles psacln 4096 Aug 11 20:47 themes drwxrwxrwx 2 apache apache 4096 Sep 9 02:08 uploads
Yet, I’m still getting:
The uploaded file could not be moved to /var/www/vhosts/nicoleandmyles.com/httpdocs/nicole/wp-content/uploads.
Which I don’t understand. I thought php is running as apache:apache. Why can’t it move a file from /tmp to the …/uploads directory? But it works when I make it myles:psacln w/ 777 permissions.
Hey all, I’ve had the exact same problems list above. I believe turning off the monthly sorting of the images was the only thing that helped. Images FINALLY upload.
Info on my uploaded files still indicate that they are being written and owned by user “apache”. That seems to be the root of the problem. If anyone discovers why this is happening, please post it here!
Thanks for all the suggestions.
I decided to simply create a folder via FTP for each month (07, 08, 09 …) and it worked. I’ll be doing this until I figure something else. It’s not a big deal for me to create the folders anyway … ??
Changing the CHMOD of the contents folder does not work. Nothing does as suggested above. FTPing all my files work BUT I cant see them as admin browsing my gallery. Im linking “blind” in HTML format. If anyone knows any other solution other than those mentioned above, please post. Would greatly appreciate the help ??
I had a custom theme created and from the very start I have never been able to upload an image. I have read the posts and it seems like greek to me. I would appreciate it greatly if someone could walk me through this. Here is the message I get when ever I try to upload an image to wordpress:
The uploaded file could not be moved to D:\Inetpub\javalama/wp-content/uploads.
Please help!
So, even though this topic is marked as resolved, it doesn’t seem to be. Is this simply a problem that cropped up in the current instance of WP, and we have to wait for another update?
As far as I can tell from reading through this, many of us are facing multiple problems with the media library upload.
Is there a fix someone can explain?
I know I am missing some basic things here. When I read:
– login to your ftp
– make your wp-content folder 755
– inside wp-content create a new folder called “uploads”, make it 777
– inside the control admin panel, go to settings>miscellaneous and on the first line enter “wp-content/uploads” as where your uploads will go to.
Save and go try to ad a new image in a post and it will work superbI don’t know what it means to make a folder 775 or 777. It doesn’t seem to mean renaming it. Where would I make these changes? Sorry!
If you are on a mac, you just right click the folder or file located in the server via FTP, click on Info and enable the “write” and/or “execute” options until you see it displaying 777. I forgot how to do it on Windows cause I haven’t worked on it for a long time but I guess you have to go on Properties, but I guess you can google it :>)
I can’t figure out if this is a user error or a program issue. I have had my site for a couple years and never encountered this issue. I have recently changed hosting companies. I transferred the blog and I am having a similar problem. The only thing that changed is the WP version was updated.
I have tried every fix technique listed on these forums and if someone mentions changing the permissions to 777 again my head will explode.
I can manually upload content to the proper directories and use html to get the job done, but I also host 2 other WP sites for individuals without access to an ftp (filezilla) type directory system.
In any given post when I go to add new media content, then browse the computer for the files, WP will upload, but to nowhere. The file is not located in any directory anywhere in my database. I have set my miscellaneous settings to wp-content/uploads storing the files in a year/month format but the files are not actually placed in any directory. Even with 777 on the directories permissions.
The only thing I can think could be contributing to the issue is that I have a total of 6 sites operating under one hosting account. So my personal site joshmossotti.com it a child to artbyfable.com. However the parent account does not have anything to do with regards to the directory structure of the personal site.
I am not sure if I feel better or worse that there are this many people experiencing similar issues. I will continue to check back to see if there is either an update or a fix.
I suggest you post it as a new link. Since this page shows this issue as “Resolved” it is probably not reaching the geeks on duty. I did this for another issue and I got help from a good samaritan within a few minutes and all the way until I got my problem resolved. Since I’m a newbie I recommend you to go that way. I know how to fix 777 via FTP using a free application called Cyberduck but I’m a Mac user. But there must be hundreds out there that are Windows users and that are more experienced than I am. I got your post just because I still had this thread on my RSS reader but I don’t think you will be lucky getting answers faster via a “Resolved” post.
Permissions for upload directories must be set to 777 because being a web application WordPress runs as the user apache and not as owner. The ‘uploads’ directory needs to be created manually via SSH or FTP and set to 777, as well any directories inside, such as ‘2009’, and the directories inside that, i.e. ’10’, ’11’, ’12’, etc. Web applications such as WordPress have limited abilities to create directories.
I think you are all missing the point here. Remember that on a unix / linux server you have to set permissions AND ownership. You can set permissions on a folder but if you are not the owner than you can’t copy files in there.
When you upload files with the media form in WordPress, files are being stored in a temporay location. When the upload is succesfull WordPress tries to move them to your upload folder. Normally that is wp-content/uploads. It will only succeed if your write permissions are ok (and no, 777 is not needed, just make sure that you have write permissions. 666 should be enough.
When the write permissions are correctly set you should make sure that you own the uploads folder. Your FTP client should show who owns the folder. This should be the loginname that you use to connect to the ftp server.
I noticed when I had the problem that the owner of the uploads folder was not correct. So I used the quick and dirty solution:
1. rename your uploads folder to uploadsold
2. make a new uploads folder and set the permissions to 666
3. drag the contents of the uploadsold folder to the uploads folder
4. remove the now empty uploadsold folder (check first)Presto your done! Uploading now works like a charm because both owner and permissions are ok. No SSH access needed. Just use your FTP client.
Astalapasta from The Netherlands,
Stef
You need to set permissions to 755 on the uploads directory then find out which group the web server belongs to and set the group on uploads to that value. So, for Apache at least,…
1) Run a phpinfo() script.
2) Look for the ‘User/Group’ line. That will tell you the user and group Apache runs under. On my local devel server it runs as part of the group ‘daemon’.
3)cd
to wp-contents if you aren’t already there, create the uploads directory if it isn’t there, and thenchown <owner>:daemon uploads
. (Or use your ftp client as already explained up above.) You shouldn’t have to mess with the owner so just keep that value as it was.You might have to ask your web host to make some of these changes for you. You can probably change permissions but you might not be able to change the group.
Arghh… that should be ‘set permissions to 775’.
- The topic ‘Media Upload Problem (The uploaded file could not be moved to error)’ is closed to new replies.