Title: Upload path is wrong
Last modified: August 31, 2016

---

# Upload path is wrong

 *  [crazybeardedman](https://wordpress.org/support/users/crazybeardedman/)
 * (@crazybeardedman)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/upload-path-is-wrong/)
 * 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://wordpress.org/plugins/amazon-s3-and-cloudfront/](https://wordpress.org/plugins/amazon-s3-and-cloudfront/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [damanmehta](https://wordpress.org/support/users/damanmehta/)
 * (@damanmehta)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/upload-path-is-wrong/#post-7456462)
 * [https://wordpress.org/support/topic/broken-images-50?replies=4#post-8665680](https://wordpress.org/support/topic/broken-images-50?replies=4#post-8665680)
 *  [jc21](https://wordpress.org/support/users/jc21/)
 * (@jc21)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/upload-path-is-wrong/#post-9047145)
 * 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 9 years, 1 month ago by [jc21](https://wordpress.org/support/users/jc21/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Upload path is wrong’ is closed to new replies.

 * ![](https://ps.w.org/amazon-s3-and-cloudfront/assets/icon-256x256.jpg?rev=1809890)
 * [WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage](https://wordpress.org/plugins/amazon-s3-and-cloudfront/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-s3-and-cloudfront/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/reviews/)

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [path](https://wordpress.org/support/topic-tag/path/)
 * [s3](https://wordpress.org/support/topic-tag/s3/)
 * [wpmu](https://wordpress.org/support/topic-tag/wpmu/)

 * 2 replies
 * 3 participants
 * Last reply from: [jc21](https://wordpress.org/support/users/jc21/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/upload-path-is-wrong/#post-9047145)
 * Status: not resolved