26 Temmuz 2011 Salı

Sharepoint 2010: Client Object Model 2010 Upload Size Problem (aka 3 mb nightmare)

A collegue in the office was having some problems with uploading documents into a library. The thing was, he was getting errors when he uploads something bigger than 3mb.

So we tried to change web.config of the site, upload size, maxpacketlength etc. They were all looking correct, and the site collection was not loaded completely.

I guess because of the inexperience of using client object model we could not find the answer fast. It took 2 days lol

Nevermind, client object model allows you to upload Binary file directly, you will have NO problems but, Silverlight Api does not have that function, which is:

Microsoft.SharePoint.Client.File.SaveBinaryDirect

So,

If you are having problems with uploading files to the library with Silverlight or WPF Applications, then you should use,

SPWebService contentService = SPWebService.ContentService;
contentService.ClientRequestServiceSettings.MaxReceivedMessageSize = int.MaxValue;
contentService.Update();



in order to avoid this quata.

If you still see an exception, check your web.config file, search every entry that has lenght and size in its name :)

Hiç yorum yok:

Yorum Gönder