WordPress.org

Forums

WordPress FTP image uploads HELP! (8 posts)

  1. enlacosa
    Member
    Posted 3 years ago #

    Ok I had this problem in WordPress where I was unable to upload any images due to an error that read:

    Unable to create directory."(The Directory path)". Is its parent directory writable by the server?

    I spoke to some hosting represenatives and they clarified what the problem was.You can see my first post on the resolved problem here: http://wordpress.org/support/topic/unable-to-create-directory-is-its-parent-directory-writable-by-the-server-help?replies=14

    It seemed that there was so many single files within the wp-content/uploads folder in my FTP that WordPress was unable to create a 2012 folder for the images I want to upload hence why I kept on receiving the error on the uploader. The represenative suggested to delete as many old files as I can also considering the fact that the limit of files per folder is about 1000 files and the uploads folder had over 7000 single files. So it was virtually impossible for WordPress to create a 2012 folder. As soon as I eliminated some images the 2012 folder popped up and I was able to upload once again.

    Now I didn't delete all my images but just a few out of 7000 to test if this was the problem and luckily it was but I want to know how I can divide these images into 7 separate folders in my FTP of about 1000 files so that the uploads folder doesn't force my hosts to suspend my domain considering it's way past it's limitations.
    I tried creating a folder outside of the uploads folder and then moving some of the single files into that folder. Then for testing purposes I dragged the folder I created into the uploads folder. I wrote down a name of an image and then proceeded to search for it in my WordPress Media Library to see if it appears. When the search pulled up I saw that the image was blank with an X on the top left corner of the image.

    Now how am I able to divide all of these single files in my FTP into folders within my uploads folder so that WordPress is able to find these files. Something to keep in mind is that these are somewhat old files for old posts but I don't want to delete them and if I change the uploads path in WordPress, then the new files I want to upload wouldn't be saved in the 2012 folder. If anyone has a solution, I'd really appreciate it!
    Thank you

  2. jonradio
    Member
    Posted 3 years ago #

    The limit on files per folder is arbitrary, in the sense that it is a setting that a web host can set. And choose to change on per-customer basis, upon request. Or flatly refuse.

    My best advice is to find another web hosting company, one that you know, by asking in advance, will support more than 7000 files in a folder. The alternative: splitting up files in a single folder into multiple folders can be very error-prone and just plain difficult, even with a powerful tool like the Search and Replace plugin.

    How did you ever manage to get 7000 files in the root of the wp-contents/uploads folder? I have none in mine.

  3. enlacosa
    Member
    Posted 3 years ago #

    Hmm I wasn't aware of that. That's what two different represenatives have told me. To tell you the truth I have no idea how it was possible to get so many files just in the wp-contents/uploads folder. In fact the represenative was surprised himself! I've been with Go Daddy Hosting for quite some time and haven't had any issues with them and they're technical support is phenomenal unlike other hosting companies I've had in the past. I was almost positive though that I would be able to create separate folders for these images within the uploads folder. Do you think that the problem may have came from the option on the wordpress media settings where it reads: Organize my uploads into month- and year-based folders. Maybe since it wasn't checked it could have began to upload images directly in the uploads folder rather than the specific folder WordPress creates?

  4. jonradio
    Member
    Posted 3 years ago #

    Yes, that checkbox would explain it. Sorry that I didn't think of that!

    The "error-prone" comment was made because, unless you want to do 3500 search and replaces by hand with the plugin of the same name, you will have a very difficult time changing all the WordPress links to the half of your images you moved into other folders. i.e. - it is very easy to move files to a different folder, but very tedious to change a large number of links.

    I didn't think of it until now, but the only practical approach would be to divide all the files into folders based on the first character of the file name, because that would allow you to do a search and replace based on that first character. The plugin http://wordpress.org/extend/plugins/search-and-replace/ has no pattern matching, so you would have to be very careful that you included enough of the path to not match anything but links to that group of files. In general, Search & Replace tools, either plugins or your own SQL, make it very easy to corrupt your WordPress database to the point of having to recover from a recent backup.

  5. enlacosa
    Member
    Posted 3 years ago #

    Now just to clarify. Will this plugin help me to move these files into separate folders within my wp-content/uploads folder so that they aren't hanging around my uploads folder?

  6. jonradio
    Member
    Posted 3 years ago #

    Moving files into different folders is the easy part, in terms of the "entire project". That you could do with FTP: copy to hard disk, delete old ones from /uploads/ and copy to new location.

    All the plugin does is change every reference in the WordPress database from
    wp-contents/uploads/a
    to
    wp-contents/uploads-2/a/a

    That example is probably the best way to do this: creating another uploads-2 folder. If you divide up into folders within /uploads/ then your use of the plugin could cause you grief at some point. For example,
    wp-contents/uploads/a
    to
    wp-contents/uploads/files-a/a
    would some unexpected things when you got to
    wp-contents/uploads/f
    to
    wp-contents/uploads/files-f/f

  7. jonradio
    Member
    Posted 3 years ago #

    I see I haven't said it before, and should have.

    Because this is such an error-prone project, be sure you have backups of both all your WordPress files AND your WordPress database before you attempt any of this. And keep it for quite a while, in case some weird problems crop up.

    Beyond that, I always clone my WordPress site and perfect my conversion methods BEFORE trying it on the live system.

    I'm not sure how feasible this is, but the best way to do anything this big is to lock down your web site to changes (i.e. - no new posts), clone your live system, make all the changes to the clone, and the clone becomes your new live system. I use the techniques on this page http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory to quickly flip from one WordPress to another (a modified clone). Each resides in a separate directory/folder, and a simple change to the index.php file in the root changes the folder referenced when you type in the http://example.com domain name.

  8. enlacosa
    Member
    Posted 3 years ago #

    Alright I will definitely look into that. I wasn't aware about the whole cloning WordPress process. I will give it a try and see if it's worth it. If worst comes to worst though, then I'll probably just remove those images completely, besides they're old posts anyway. I appreciate all the help though adiant! Great information! :P

Topic Closed

This topic has been closed to new replies.

About this Topic