Title: CSV link bug (using multisite)
Last modified: August 20, 2016

---

# CSV link bug (using multisite)

 *  Resolved [andersjohansson](https://wordpress.org/support/users/andersjohansson/)
 * (@andersjohansson)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/csv-link-bug-using-multisite/)
 * Thanks for a very useful plugin.
    I have unfortunately discovered an annoying
   bug. When using multisite (possibly also on single blog) the link to csv files
   on public lists has the wrong url. Where it should be: `http://www.website.com/
   wp-content/uploads/users_csv/user_list_4.csv` it outputs `http://www.website.
   com/LOCAL-FILESYSTEM-PATH/wp-content/uploads/users_csv/user_list_4.csv`.
 * I did som debugging and localized the bug to `amr_users_get_csv_url` (`amr-users-
   csv.php:172`). Line 175 reads:
    `$csvurl = str_replace($upload_dir,$upload_url,
   $csvfile); // get the part after theupload dir` this is clearly wrong, since `
   $upload_dir = wp_upload_dir()` is an array and `$upload_url = $upload_dir['baseurl']`
   is a string.
 * I suppose it should read:
    `$csvurl = str_replace($upload_dir['basedir'],$upload_dir['
   baseurl'], $csvfile); // get the part after theupload dir`
 * Replacing the `basedir` (local filesystem path) part of `$csvfile` with `baseurl`(
   url to uploads directory).
 * However, also this would fail on multisite, since it appears that csv-files are
   placed under `/wp-content/uploads/users_csv/` and not in the blog-specific upload
   directories `/wp-content/blogs.dir/X/files` (actual directory, X is blog id) 
   accessible at `SUBBLOGURL/files` (public url) which are what `wp_upload_dir()`
   will return for a specific blog in a multisite install (as `basedir` and `baseurl`)
 * Maybe there is a good reason for using this special directory though since four
   lines in `amr_users_get_csv_path` (`amr-users-csv.php:152-155`) specifically 
   rewrites the upload path from blog-specific values to “/wp-content/uploads/users_csv/”.
   In that case, I guess the fix that is needed only concerns `amr_users_get_csv_url`
   where this special directory should be used instead of the blog specific ones.
 * Greetings,
    Anders Johansson
 * [http://wordpress.org/extend/plugins/amr-users/](http://wordpress.org/extend/plugins/amr-users/)

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

 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/csv-link-bug-using-multisite/#post-3156995)
 * Hi Anders
 * tack så mycket
 * Will have a fix up soon.
 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/csv-link-bug-using-multisite/#post-3157012)
 * Meant to have this up soon – had Internet and pc hiccups … anyway now there –
   see version 3.5.
 * Please let me know asap if you find a problem. I have the link working fine forpublic
   lists on subsites my local multisite install
 *  Thread Starter [andersjohansson](https://wordpress.org/support/users/andersjohansson/)
 * (@andersjohansson)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/csv-link-bug-using-multisite/#post-3157013)
 * It works great on both my local test site and the live site. Thanks!

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

The topic ‘CSV link bug (using multisite)’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amr-users_f6f6f4.svg)
 * [amr users](https://wordpress.org/plugins/amr-users/)
 * [Support Threads](https://wordpress.org/support/plugin/amr-users/)
 * [Active Topics](https://wordpress.org/support/plugin/amr-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amr-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amr-users/reviews/)

## Tags

 * [csv](https://wordpress.org/support/topic-tag/csv/)

 * 3 replies
 * 2 participants
 * Last reply from: [andersjohansson](https://wordpress.org/support/users/andersjohansson/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/csv-link-bug-using-multisite/#post-3157013)
 * Status: resolved