title: Access to file on network drive asp net core
body: <p>I open file by asp core endpoint successfully:</p>
  <pre><code>        [HttpGet(&quot;files/{fileName}&quot;)]
          public IActionResult GetFile(string fileName)
          {
              var filePath = _hostingEnvironment.ContentRootPath + &quot;\\Files\\&quot; + fileName;
              if (filePath == null) return NotFound();
              return PhysicalFile(filePath, MimeTypes.GetMimeType(filePath));
          }
  </code></pre>
  <p>The file is in the server local folder:</p>
  <pre><code>C:\inetpub\wwwroot\myProject\files
  </code></pre>
  <p>I want to do the same with network folder mounted as disk <code>R:\</code>:</p>
  <pre><code>var filePath = &quot;R:\\Files\\&quot; + fileName;
  </code></pre>
  <pre><code>R:\files
  </code></pre>
  <p>But this do not works with error 500.
  I also can open file from <code>R:\</code> directly by windows explorer with login &amp; password.
  So how to get access to the network drive file?</p>