title: How to download a file from another Sharepoint Domain
body: <p>I need to download a file stored in a SharePoint server that is in a different domain from the user.  I've found the code below and it looks exactly like what I need.</p>
  
  <pre><code>using (FileInformation ffl = Microsoft.SharePoint.Client.File.OpenBinaryDirect(_clientCtx, serverFilePath))
  {
      using (Stream destFile = System.IO.File.OpenWrite(completeDestinationPath))
      {
          byte[] buffer = new byte[8 * 1024];
          int len;
          while ((len = ffl.Stream.Read(buffer, 0, buffer.Length)) &gt; 0)
          {
              destFile.Write(buffer, 0, len);
          }
      }
  }
  </code></pre>
  
  <p>My problem is that I do not know to how supply the user name &amp; password that will allow access to the SharePoint server so I can download the file.</p>