WordPress.org

Forums

update change uploads to blogs.dir folder (11 posts)

  1. pacotole
    Member
    Posted 12 months ago #

    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?

  2. pacotole
    Member
    Posted 12 months ago #

    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);
  3. *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?

  4. pacotole
    Member
    Posted 12 months ago #

    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.

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

  6. pacotole
    Member
    Posted 11 months ago #

    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...

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

  8. pacotole
    Member
    Posted 11 months ago #

    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...

  9. nginx shouldn't matter here.

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

  10. pacotole
    Member
    Posted 11 months ago #

    ms_files_rewriting is set to 1

  11. Change that to 0

Reply

You must log in to post.

About this Topic