• According to the offload s3 plugin PATH setting:
    By default the path is the same as your local WordPress files

    This simply isn’t true. For whatever reason it wants to prefix my blog directory with “sites/”.

    Even when I put a path in this setting this happens. For example, our blog images go locally to:

    wp-content/blogs.dir/[site_id]/files/[year]/[month]

    So I set the path for wp-content/blogs.dir.

    The plugin uploads all my images to:
    [bucket]/wp-content/blogs.dir/sites/[site_id]/files/[year]/[month]

    That isn’t where the plugin obtained the images to upload, so why is it creating it in the bucket? It deletes images locally just fine, btw.

    Thanks
    Brian

    https://www.ads-software.com/plugins/amazon-s3-and-cloudfront/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’ve digged in to this myself today and I believe the code logic is incorrect for our wordpress multisite setups.

    File: amazon-s3-and-cloudfront.php
    Function: get_dynamic_prefix

    There is a line that determines how to prefix the multisite dir:

    if ( defined( 'MULTISITE' ) ) {

    Which is incorrect. I do not define MULTISITE in my configuration but WordPress is defining it later in wp-settings.php as FALSE. The line should be:

    if ( defined( 'MULTISITE' ) && MULTISITE ) {

    And then later in that function, replace:

    if ( is_multisite() && ! ( is_main_network() && is_main_site() ) && false === strpos( $prefix, 'sites/' ) ) {

    with:

    if ( defined( 'MULTISITE' ) && MULTISITE && is_multisite() && ! ( is_main_network() && is_main_site() ) && false === strpos( $prefix, 'sites/' ) ) {

    Would be great if this change made it to a new version so I don’t have to hotfix this plugin. Thanks

    • This reply was modified 7 years, 10 months ago by jc21.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Upload path is wrong’ is closed to new replies.