I am using Client Object Model to interact with Sharepoint 2010. When I tried to upload documents greater than 3 MB using Client OM, it gave an error Bad Request. Microsoft suggests this to fix the problem. I tried that and updated the maxReceivedMessageSize property. It works fine after I restart the system, but doesnt get applied to a running sharepoint server.

I assume that as the setting might have been kept in memory, so needs an application reset, but I cudnt figure out what to reset. I have tried reseting different Sharepoint services. I have tried reseting Sharepoint website in IIS. Nothing helps.

Also, if I set a limit of 10 MB for example, I am able to upload documents around 7.5 MB. I think that is because of additional metadata (content-type properties etc). Is this correct behaviour or I need to change something else as well.

Would appreciate any help.



It is basically just a WCF service, and the code that you are running is just an API to modify the web.config (across all servers in the farm). I am guessing, that by the time I am answering this the problem has already resolved itself, since the App Pools would have been recycled automatically several times by now. However, you can have those settings take effect by either doing an IISRESET on each server, or by recycling the SharePoint web services app pools.

To answer your other question, the maxReceivedMessageSize pertains to the whole message, so yes it is not just the binary file you are uploading. Also, the file is buffered into a byte array, and then serialized, so there is a good bit of "overhead" in the message.

As you increase the maximum message size, you may see a lot of CPU/MEM spiking on both the client and server buffering large binaries (not as efficient as streaming). I would also add that as you increase the message size you will probably run into errors related to other configured limits, such as maxArrayLength, so you may need to make additional changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.