title: Uploading sharepoint document exception using SaveBinaryDirect
body: <p>I have a Windows Application that saves .pdfs to a SharePoint Document Library.  It works fine except this one file.  Whenever I use SaveBinaryDirect with this 10.1MB file I get the following exception:</p>
  
  <pre><code>System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---&gt; System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---&gt; System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
     at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
     at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
     --- End of inner exception stack trace ---
     at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
     at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
     at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
     --- End of inner exception stack trace ---
     at System.Net.HttpWebRequest.GetResponse()
     at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()
     at Microsoft.SharePoint.Client.File.SaveBinary(ClientContext context, String serverRelativeUrl, Stream stream, String etag, Boolean overwriteIfExists, SaveBinaryCheckMode checkMode)
     at Microsoft.SharePoint.Client.File.SaveBinaryDirect(ClientContext context, String serverRelativeUrl, Stream stream, Boolean overwriteIfExists)
     at BKWatch.BKWatchViewModel.UploadDocument(String siteURL, String documentListName, String documentListURL, String documentName, Byte[] documentStream, Int64 AccountId, String DebtorName, Nullable`1 Pages, String Title) 
  </code></pre>
  
  <p>I have already tried the following:</p>
  
  <pre><code>clientContext.PendingRequest.RequestExecutor.WebRequest.KeepAlive = false;
  
  System.Net.ServicePointManager.MaxServicePointIdleTime = 600000;
   clientContext.RequestTimeout = 600000;
  </code></pre>
  
  <p>Increasing max size in SharePoint - already at 50 MB
  Increasing max size in IIS web.config - Already at 2GB</p>
  
  <p>Thanks.</p>