title: Unity cannot retrieve files from server on local network, connection fails?
body: <p>I'm setting up a multiplayer game where I need to save and load data inside of the Unity3D game from a server on my local area network. This data would be account information, scores, unlocks, etc. Pretty much all textual data.</p>
  
  <p>It is local to my network mainly as a means of testing it out before or if it goes global.</p>
  
  <p>The problem is that I cannot access the files I need to create or download from the local server from within the Unity application Play mode. I'm doing this inside of the editor, don't believe that makes a difference.</p>
  
  <p>My setup is this: A Laptop running Unity - That same laptop temporarily acting as the server with a shared directory holding all of the data text files.</p>
  
  <p>In my code, I link the URL to the directory on the server (laptop).</p>
  
  <pre><code>public static string path = "file://192.168.1.51/PINION/GAMEDATA/testing/userData.txt";
  </code></pre>
  
  <p>The IP is static so it does not change., and yes I know that will only work locally, which is what I'm trying to do right now.</p>
  
  <p>In visual studio, if I control click the URL, it opens the user data file in notepad so I know the link is good. But when I run it in Unity with the code below, I get a "Cannot connect to destination host" error.</p>
  
  <pre><code>IEnumerator LoadingData(){string url = ServerMaster.path;
  
      UnityWebRequest request = UnityWebRequest.Get(UnityWebRequest.EscapeURL(url));
  
      yield return request.SendWebRequest();
  
      string[] pages = url.Split('/');
      int page = pages.Length - 1;
  
      if (request.isNetworkError)
      {
          Debug.Log("Network Error occurred. " + request.error); StopAllCoroutines();
      }
      else if (request.isHttpError)
      {
          Debug.Log("HTTP Error occurred. " + request.error); StopAllCoroutines();
      }
      else
      {
          print("Download successful. " + pages[page] + ":\nReceived: " + request.downloadHandler.text);
          print(request.downloadHandler.data.Length);
      }
  }
  </code></pre>
  
  <p>I then run this bit of code which works fine which tells me the problem has to be with my LAN code.</p>
  
  <pre><code>IEnumerator LoadingData()
  {
      string testURL = "https://www.google.com/";
  
      using (UnityWebRequest www = UnityWebRequest.Get(testURL))
      {
          yield return www.SendWebRequest();
  
          if (www.isNetworkError || www.isHttpError)
          {
              Debug.Log(www.error);
          }
          else
          {
              Debug.Log("Get Request Completed!");
          }
      }
  }
  </code></pre>
  
  <p>That works fine while my other code pointing to the local server continually fails. I'm new to this networking portion of Unity so I'm having a difficult time figuring this out.</p>