• I have a multisite with three blogs.

    Previous to upgrade the uploads are like this:

    mainsite.com --> wp-content/uploads/2014/8
    sub1.mainsite.com --> wp-content/uploads/sites/2/uploads/2014/8
    sub2.mainsite.com --> wp-content/uploads/sites/3/uploads/2014/8

    After the upgrate to WP 3.9.2 and apply “Ppgrade network” the uploads are like this:

    mainsite.com --> wp-content/uploads/2014/8
    sub1.mainsite.com --> wp-content/blogs.dir/2/files/2014/8
    sub2.mainsite.com --> wp-content/blogs.dir/3/files/2014/8

    The src of images are like sub1.mainsite.com/files/2014/8/image.jpg loosing all older images previous to the upgrade.

    How can I solve it?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Pacotole

    (@pacotole)

    I tried to modify Upload path to wp-content/uploads but still upload files to blogs.dir

    I temporarily solved this issue coping files form uploads/sites to blogs.dir and appling this filter:

    function tt_wpmu_clean_atachment_url( $url, $id ) {
            global $blog_id;
            if ($blog_id > 1) $url = preg_replace('/\/files\//' , "/wp-content/blogs.dir/$blog_id/files/", $url);
            else $url = preg_replace('/\/sites\/0\//' , '/', $url);
            return $url;
    }
    add_filter('wp_get_attachment_url' , 'tt_wpmu_clean_atachment_url', 10, 2);
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    *blink* Well THAT is a weird regression. blogs.dir is from pre WP 3.5 stuff, and shouldn’t be possible. Did you originally have WP 3.5?

    Thread Starter Pacotole

    (@pacotole)

    No, the first versión of multisite start with WP 3.9 and I’m sure that folder blogs.dir not exist before the update.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I can’t find anyone else who’s had this issue. What plugins are you running? Did any of them update recently?

    Thread Starter Pacotole

    (@pacotole)

    At the time I updated WP I installed the Jetpack plugin but enabling or disabling it the behavior is the same.

    Other plugins installed are Acunetix WP Security, Broken Link Checker, Contact Form 7, WordPress SEO…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    What are the values for Upload Path, Upload URL Path and Fileupload Url.

    Thread Starter Pacotole

    (@pacotole)

    In the main blog:
    Upload Path –> wp-content/uploads
    Upload URL Path –> http://mysite.com/wp-content/uploads
    Fileupload Url –> ?? not in site settings

    In the sub-blogs the values are empty.

    I tried in a sub-blog with the values for Upload Path wp-content/uploads and wp-content/uploads/sites/2 but with the same behavior.

    If it can be useful, the WP is running on an Nginx server…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    nginx shouldn’t matter here.

    Can you look in the wp_sitemeta table for ms_files_rewriting and see what that’s set to?

    Thread Starter Pacotole

    (@pacotole)

    ms_files_rewriting is set to 1

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Change that to 0

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘update change uploads to blogs.dir folder’ is closed to new replies.