# PB Media Cloner causing weird issue on multi app server infrastructure?

**URL:** <https://pressbooks.community/t/pb-media-cloner-causing-weird-issue-on-multi-app-server-infrastructure/859>\
**Category:** Developer Questions\
**Created:** [January 18, 2019, 1:12am UTC](https://pressbooks.community/t/pb-media-cloner-causing-weird-issue-on-multi-app-server-infrastructure/859 "2019-01-18T01:12:36Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![dac.chartrand](https://pressbooks.community/user_avatar/pressbooks.community/dac.chartrand/32/152_2.png) [@dac.chartrand](https://pressbooks.community/u/dac.chartrand)\
**Post date:** [January 30, 2019, 9:30pm UTC](https://pressbooks.community/t/pb-media-cloner-causing-weird-issue-on-multi-app-server-infrastructure/859/8 "2019-01-30T21:30:41Z")

</div>

I think the UPLOADS constant is just some sort of creative writing in the documentation. The code I am (now) looking at is doing:

`$dir = ABSPATH . UPLOADS;`

So maybe UPLOADS is only to control the suffix. I think you’ll have better luck with this filter:

```php
	/**
	 * Filters the uploads directory data.
	 *
	 * @since 2.0.0
	 *
	 * @param array $uploads Array of upload directory data with keys of 'path',
	 * 'url', 'subdir, 'basedir', and 'error'.
	 */
	$uploads = apply_filters( 'upload_dir', $cache[$key] );

```

It will pass an array, and you would want to try to change `$uploads['path']`, I think.

I’ve never looked into this before. You might want to get a second opinion. My point is the uploads path is coming from `wp_handle_upload` (and `wp_upload_dir`) so I’m not sure it’s a Pressbooks problem, that’s all.

# New Idea

Maybe we shouldn’t be storing the fullpath of a file, just the relative path, between steps.

---

_[View the full topic](https://pressbooks.community/t/pb-media-cloner-causing-weird-issue-on-multi-app-server-infrastructure/859)._
