Jaa


Error Message "Server not found" while uploading a file more than 10 MB

If you trying to upload the file which is more than 10 Mb thought Silverlight client object Model and you will see an error message “Server not found”.

I faced the same issue and taken the fiddler trace while uploading the file. I saw it calling “Client.svc” windows communication foundation service. To narrow down the issue, I created a console application. Call the client.svc and reproduced the issue.

I created one more application application where I have used the SharePoint Server Object Model and able to upload the files which are more than 10 MB. So issue was because of Client.svc uploading limit. This service is available in SharePoint Root folder\ISAPI. I changed the file but didn’t get any success.

After doing some research, I have run the following code on SharePoint 2010 server :-

    1: using System;
    2: using System.Collections.Generic;
    3: using System.Linq;
    4: using System.Text;
    5: using Microsoft.SharePoint.Administration;
    6:  
    7: namespace ConsoleApplication2
    8: {
    9:     class Program
   10:     {
   11:         static void Main(string[] args)
   12:         {
   13:  
   14:             SPWebService ws = SPWebService.ContentService;
   15:  
   16:             ws.ClientRequestServiceSettings.MaxReceivedMessageSize = -1;
   17:  
   18:             // SPWcfServiceSettings has other Properties that you can set.
   19:             SPWcfServiceSettings csomWcfSettings = new SPWcfServiceSettings();
   20:             csomWcfSettings.MaxReceivedMessageSize = 50000000; 
   21:             ws.WcfServiceSettings["client.svc"] = csomWcfSettings;
   22:  
   23:             ws.Update();
   24:  
   25:             Console.Write(ws.WcfServiceSettings["client.svc"].MaxReceivedMessageSize.ToString());
   26:         }
   27:     }
   28: }

Done the IISRESET and able to upload the file.