title: Error while uploading document to SharePoint 2013
body: <p>I am getting the following error while uploading file from local computer to share point. i am using CSOM with C#.</p>
  
  <p>The remote server returned an error: (401) Unauthorized.</p>
  
  <pre><code>using (var clientContext = TokenHelper.GetS2SClientContextWithWindowsIdentity(hostWeb, Request.LogonUserIdentity))
          {
              using (FileStream fileStream =
              new FileStream(@"C:\sage\uploaded.docx", FileMode.Open))
                  SP.File.SaveBinaryDirect(clientContext,
                      "/Shared Documents/uploaded.docx", fileStream, true);
          }
  </code></pre>
  
  <p>I already set "full control" permission on Web, Lists and Site Collection</p>