The MU forums have moved to WordPress.org

Overcoming 32K folders problem in blogs.dir (6 posts)

  1. Ryan1
    Member
    Posted 15 years ago #

    Hi guys, once again I would like to raise the issues regarding the "blogs.dir" and the limit of 32,000 folders that it can have.

    After searching this forum, I have found 2 solutions:

    1) define( "UPLOADS", "wp-content/blogs.dir" . strrev(chunk_split (strrev(md5($wpdb->blogid)), 2,'/')) . "/files/" );

    2) $offsetLeft = intval($intPadLength - strlen(trim($wpdb->blogid)));
    $strPadded = str_repeat('0', $offsetLeft) . $wpdb->blogid;
    define( "UPLOADS2", "wp-content/blogs.dir" . strrev(chunk_split (strrev($strPadded), 2,'/')) . "/" );

    However, as I understand, these solutions can be implemented on a fresh WPMU install but what can I do with an Existing install? If I use of of these methods, the files in the EXISTING blogs will no longer be available because the folder structure will now be different...

    what i thought of doing is putting a if $current_blog->ID < 1000 (current highest blog id) >> use old folder structure, else use new structure...however cant seem to make this work...please help

    And also, all threads about this issue with the uploads folder seem to be 1 year old, how do you guys deal with uploads now, how do you separate uploads into different folders/servers when they get too large?

    Tnx for any help!

  2. Ryan1
    Member
    Posted 15 years ago #

    up!

  3. tdjcbe
    Member
    Posted 15 years ago #

    Same as before. If you review the code where the first solution is copied, there's a second line in there and you have to modify both of them but it's the same general principle.

    By the way, bumping is rude, especially when done so fast. Also please don't start new threads where older ones exist. On my support forums, you'd own our Charity of the Month a buck for each for doing that.

  4. Ryan1
    Member
    Posted 15 years ago #

    tnx ill decide myself when to bump,ok? not to mention its not your support forums

  5. tdjcbe
    Member
    Posted 15 years ago #

    Um, no, actually it's not ok. It's rude and against the forums rules. So's attacking those who tried to help you. Rest assured that I won't be making that mistake again.

  6. Ryan1
    Member
    Posted 15 years ago #

    ill live with that

About this Topic