• Fresh install of 2.8.1 for a new site and I keep getting

    Error saving media attachment.

    when I try to upload a media file. My wp-content/uploads exists, has been chmod 777 -R and “Store uploads in this folder” is set to wp-content/uploads in the miscellanous settings. Plugins have been turned on and off, different directory tried but still not working.

    I’ve tried the suggestions on the Image/Media Uploader problems? post but that doesn’t resolve it. Am I missing something obvious here?

Viewing 13 replies - 16 through 28 (of 28 total)
  • I had a similar issue when I migrated a wp site from one server to another. Everything seemed to work fine but I couldn’t upload files to the media library.

    As has already been mentioned in this thread the issue is the file permissions and ownership settings of the uploads & wp-content directories on the server.

    If you have ssh access to the server you should be able to sort this out. I didn’t have any luck deleting and recreating the uploads folder using ftp.

    I’ve come across this issue before so decided to do a little more research. I’ve made some progress in changing file permissions (chmod) but I don’t have root access so I’m unable to change ownership (chown). But the issue has been solved by changing the uploads and wp-content directories to 775.

    I found this rather handy little tutorial on chmod which is the unix command to change file permissions.

    This page also explains how 777 and 775 are derived as I didn’t know what they meant either. Hope this clears the air a little for the other web designers out there wrestling with server issues.

    For IIS6 on Windows Server 2003 the issue may be a little different….

    To make sure that your permissions are right, right click on your “..\wp-content\uploads” directory, click “Sharing and Security” then click the “Security” tab. Here, select your “Internet Guest Account” and make sure that it has FULL permissions on this folder.

    Then, in WordPress’ Admin dashboard, click on “Settings > Miscellaneous” and set “Store uploads in this folder” to “\wp-content\uploads”. The first slash (“\”) is definitely needed on 2003 Server – whereas it may not be needed on Apache.

    Good luck – I hope this helps…

    wow, well, at least I’m not alone in this…

    Just changed hosts for a client’s blog and am unable to upload media via the Flash or Browser modes. I’m getting the:

    “Error saving media attachment”

    with the Browser mode and the Flash mode says:

    “Unable to create directory D:\Hosting\5300379\html/wp-content/uploads/2010/02. Is its parent directory writable by the server?”

    I’m completely unfamiliar with chmod and permissions but I did try changing the 666 to 777 in the editor. No dice.

    One thing that does work for me, though, is manually entering the URL of the image. Although, that is a temp fix as we need to get this issue SOLVED. Manually entering the url will allow the image to appear in the posts, but the post images are not feeding through to the home page. That’s probably something else entirely…

    Hi,
    thanks for that helpful suggestion

    edmin’s solution worked for me – that was almost too easy.

    I Fixed the issue by Chrome-ing my uploads directory to 777 and then going to miscellaneous options in settings and UN-CHECKING the option that says “Organize my uploads into month- and year-based folders” Save Changes and thats it.

    I tried everything and no joy until the last post by fzo and bingo! Thanks!

    This bug hit me today out of the blue. The post by fzo fixed it. The images where already 644 (the default I think) and the upload dirs are 777 on my host. All I had to do was un-check “Organize my uploads into month- and year-based folders”.

    A Shoot out to fzo: You rule man, this fix is da bomb. ??

    It finally worked.

    If you are still having problems after trying all the great suggestions here, then selinux might be getting in your way if you are running it.

    For a quick test:

    1. turn selinux off (as root: setenforce 0)
    2. try to save your file
    3. turn selinux back on (as root: setenforce 1)

    If you were able to save your file, then the selinux context on your uploads directory is wrong.

    To correct (as root):

    1. cd to the parent folder of the uploads directory
    2. use the chown -R <uname>: uploads command to ensure that the uploads directory and all sub-directories are owned by the uid of the webserver (e.g. chown -R apache: uploads)
    3. use the command restorecon -R uploads to ensure that the uploads directory and any sub-directories have the correct selinux security context

    After this you should be able to save your images.

    I hope this helps!

    Hi all,

    I have the same problem, in my case it was my server service provider that only let my upload in a folther name “public” then wp cant use the folther “uploads”.

    I solved redirecting my upload folder in Settings > Miscellaneous > Store uploads in this folder to “public/uploads” the true 777 folder in my site.

    sorry my english

    I had the same problem…using the basic uploader I got the error:

    Error saving media attachment.

    Using the flash uploader, I got an error about file permissions on the server.

    I tried deleting the uploads folder, changing permissions to 777, 755 etc etc. But nothing helped

    My fix: I unchecked the “Organize my uploads into month- and year-based folders” checkbox in /wp-admin/options-misc.php and that seems to work.

    I found I didn’t have a wp-content/uploads folder so I created one and set up permissions and ownership. Looks like I’m good now.

    If you’re a Linux noob what I did was navigate to the wp-content directory and created the /uploads directory with:

    sudo mkdir uploads
    sudo chown root:www-data uploads
    sudo chmod 755 uploads

    So that’s a make-directory, a change ownership and change of access mode, i.e. read, write, execute, etc.

    The “sudo” stuff is because I’m running Ubuntu which discourages the use of supervisor mode.

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘Error saving media attachment’ is closed to new replies.