Title: Incorrect Scan Directory (slashes facing wrong way) causing problems
Last modified: April 25, 2020

---

# Incorrect Scan Directory (slashes facing wrong way) causing problems

 *  Resolved [veriatech](https://wordpress.org/support/users/veriatech/)
 * (@veriatech)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/)
 * Preface: I am a sysadmin running WordPress on a Windows Server 2019 + IIS + latest
   version of MySQL & WP.
 * With this plugin installed, here is what it thinks my scan directory is:
 * Scan Directory: D:\home\mywebsite.com\wp/wp-content/uploads\
 * Whenever I import media (mainly video files), it keeps the trailing backslash
   in the URL thus causing an incorrectly formatted URL reference.
 * Can this be fixed? My workaround has been to go into the MySQL DB and manually
   change which way the slash faces. I’m doing it directly in the DB since I have
   hundreds of files to deal with. Thanks for your time and attention in this matter!

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

 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12730738)
 * Hi [@veriatech](https://wordpress.org/support/users/veriatech/), that seems bad.
   But this plugin uses `DIRECTORY_SEPARATOR` on all the places for this reason (
   so that it’s `\` on Windows and otherwise `/`). But I just realized WordPress
   functions (used by this plugin) force the use of `/`:
    [https://developer.wordpress.org/reference/functions/get_home_path/](https://developer.wordpress.org/reference/functions/get_home_path/)
   [https://developer.wordpress.org/reference/functions/get_site_url/](https://developer.wordpress.org/reference/functions/get_site_url/)
 * So maybe this plugin should always use `/` as well. But I’m not sure if that 
   will work on the Windows server.
 * Also, which database field are you editing? Because if it’s a URL, that’s a different
   story and should always be `/` regardless of server.
 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12731070)
 * Hey [@veriatech](https://wordpress.org/support/users/veriatech/), I did a small
   change and pushed it with a new 1.1.4 version. Can you please try it out to see
   if it works on Windows Server now?
 * Thank you
 * Erol
 *  Thread Starter [veriatech](https://wordpress.org/support/users/veriatech/)
 * (@veriatech)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12731156)
 * Wow! You are amazing, Erol! Thank you for the quick response and turnaround with
   a new version! I will get it downloaded, give it a try and report back here shortly.
   Thanks so much!
 * FYI, I was editing the wp_postmeta table and the meta_value field using MySQL
   Workbench. I’m a DBA so I’ve very familiar with editing data directly in DBs.
 * Thanks again Erol and I will let you know!
 * Dennis @ Veria Tech / Veria Video
 *  Thread Starter [veriatech](https://wordpress.org/support/users/veriatech/)
 * (@veriatech)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12731192)
 * Hello Erol,
 * Still no joy. I updated to the latest plugin (1.1.4) and still get the same result.
   However, my Scan Directory now reports itself as:
 * \wp-content/uploads\
 * and the entry in the DB gets populated as:
 * D:\home\mywebsite.com.com\wp/wp-content/uploads\myvideo.m4v
 * Oddly enough, the ONLY slash that I have to correct in the DB field is the trailing
   slash just after “uploads”. Once I make that one change, all is good. I wonder
   if you could leave off the trailing slash and see if that works?
 * Thanks so much for your help!
 *  Thread Starter [veriatech](https://wordpress.org/support/users/veriatech/)
 * (@veriatech)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12731271)
 * I was also reading this article, Erol. It seems to be a gray area at best.
 * [https://cmljnelson.blog/2018/07/26/which-way-do-your-slashes-face/](https://cmljnelson.blog/2018/07/26/which-way-do-your-slashes-face/)
 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12731327)
 * Oh too bad, but thanks for the details! I’ll take a closer look tomorrow.
    Problem
   is that I can’t actually test it on Windows, but with your help, I hope we can
   solve it 🙂
 * But when you’re editing `wp_postmeta.meta_value` do you get full path there? 
   With `D:\home\...myvideo.m4v` and all that?
    Because that field should just have”
   end” of the path, so for example just ”myvideo.m4v”.
 * Also, it would help to know which path you get on initial plugin screen, before
   you click ”Scan Files”. There is also full path if you hover over that highlighted
   part.
 * Thanks
 *  Thread Starter [veriatech](https://wordpress.org/support/users/veriatech/)
 * (@veriatech)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12731553)
 * Thank you Erol! Yes, I get the FULL path in the meta_value field, not just the.
   m4v file.
 * Also, here is what the initial plugin screen shows before I click “Scan Files”
 * “Use this to see content of upload dir: \wp-content/uploads and import files 
   to Media Library.”
 * Hope that helps! Let me know anything you need at all to help! Thanks again!
 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12733372)
 * Hey [@veriatech](https://wordpress.org/support/users/veriatech/), the more I 
   read about this, the more it became obvious I should always use forward slashes.
   That’s what WordPress does and PHP on Windows Server shouldn’t have a problem
   with that.
 * I pushed it to 1.1.5 version, so could you please try it out?
 * Thanks
 * Erol
 *  Thread Starter [veriatech](https://wordpress.org/support/users/veriatech/)
 * (@veriatech)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12733686)
 * Boom! That did the trick, Erol. It works like a charm now! I cannot thank you
   enough. Thank you so much for a great plugin and your great support! Keep up 
   the great work!
 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12733768)
 * Great! I’m so glad to hear that. And it wouldn’t be possible without great insight
   from your end, so thank you!
 *  Thread Starter [veriatech](https://wordpress.org/support/users/veriatech/)
 * (@veriatech)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12734017)
 * Absolutely, Erol! Anytime! I know I am in the minority running WordPress on a
   Windows Server, but, that’s just what I have to do because I am currently hosting
   websites for customers (including my own websites) across multiple CMS platforms,
   mainly DNN (DotNetNuke) and now WordPress. I am slowly but surely getting up 
   to speed with WordPress and may be spinning up a Linux server soon just to host
   the WordPress sites. I am mainly a DBA on the Microsoft side of the world managing
   Enterprise scale DBs but I do have some coding experience as well which is why
   I am not totally oblivious to what goes on behind the scenes with the frameworks
   required to make these websites work! If you need any help at all testing anything
   for a Windows Server hosted WordPress site, please do not hesitate to look me
   up! Thanks again for your great plugin and support! I’m starting up a video site
   for the dance industry uploading hundreds of videos several GB in size each and
   uploading outside of the WP site is critical, thus comes the usefulness of your
   plugin syncing the files with the WP install! Great work, Erol! Bravo! Keep it
   up!
 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12736951)
 * Wow, it’s great hearing all of this 🙂
 * Thank you, and I wish you good luck with your future endeavors.

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

The topic ‘Incorrect Scan Directory (slashes facing wrong way) causing problems’
is closed to new replies.

 * ![](https://ps.w.org/media-sync/assets/icon.svg?rev=2021152)
 * [Media Sync](https://wordpress.org/plugins/media-sync/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-sync/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-sync/)
 * [Active Topics](https://wordpress.org/support/plugin/media-sync/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-sync/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-sync/reviews/)

## Tags

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

 * 12 replies
 * 2 participants
 * Last reply from: [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/incorrect-scan-directory-slashes-facing-wrong-way-causing-problems/#post-12736951)
 * Status: resolved