We have an windows application that uploads files to SharePoint 2010 via client object model. We have raised the upload limit as in the following article: http://msdn.microsoft.com/en-us/library/ff599489.aspx.
We have done this via powershell:
$ws = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$ws.ClientRequestServiceSettings.MaxReceivedMessageSize = 78643200 #75MB
$ws.Update()
This works fine for files up to approximately 40 MB. After that we receive the following exception:
The remote server returned an error: (401) Unauthorized.
System.Net.WebExceptionStatus.ProtocolError
at System.Net.HttpWebRequest.GetResponse() at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery() at UploadClient.FileUpload.Service.SharePointService.CreateFile
We have also tried increasing the upload size via:
public static void IncreaseUploadSize()
{
SPWebService contentService = SPWebService.ContentService;
/* Must set this to -1, else, the MaxReceivedMessageSize value for
SPWebService.ContentService.WcfServiceSettings["client.svc"] will not be used.*/
contentService.ClientRequestServiceSettings.MaxReceivedMessageSize = -1;
// SPWcfServiceSettings has other Properties that you can set.
SPWcfServiceSettings csomWcfSettings = new SPWcfServiceSettings();
csomWcfSettings.MaxReceivedMessageSize = 146800640; // 140MB
csomWcfSettings.MaxBufferSize = 146800640; // 140MB
csomWcfSettings.TransferMode = System.ServiceModel.TransferMode.Streamed;
contentService.WcfServiceSettings["client.svc"] = csomWcfSettings;
contentService.Update();
}
We have set transfermode to both Streamed and Buffered but with the same result.
Are there any other changes in form of config files that we have to update for this?
Thankful for any sugggestions / netify