Limitation of uploading big file to SharePoint 2013 with CSOM

We have recently rolled out an Outlook plugin that integrates with SharePoint. The plugin allows end users to upload selectable email to SharePoint 2013 libraries. Client-side object model (CSOM) is used for the plugin development. We realized that if the email’s size was more than 2MB, it was unable to be uploaded to SharePoint 2013 libraries. The following message was thrown out:

“The request message is too big. The server does not allow messages larger than 2097152 bytes.”

We just figured out that SharePoint 2013 has limit when using CSOM. The default value to make a request through CSOM is 2MB if you have never paid attention to CSOM setting. There is a property called MaxReceivedMessageSize in SPWebService object that is adjustable.

To allow big files to be uploaded through CSOM, use the following PowerShell snippet code:

Note: make sure SharePoint Timer service is stopped before you execute the above PowerShell

You could programmatically set the MaxReceivedMessageSize property using C# snippet code below

If you use built-in SharePoint API, you might need to read this article: Quick tip to overcome limitation of uploading using SharePoint web service

For more information about increasing the Maximum Message Size, read this article

[Update – 27/01/2015] Jason has a good tip for uploading large files via CSOM with SaveBinaryDirect method and MemoryStream.


  1. Le Van Son
    May 20, 2015 — 8:04 am

    Need to set max parse message size as well:

    $a.ClientRequestServiceSettings.MaxParseMessageSize = 209715200

  2. June 15, 2016 — 5:43 pm

    is this supported in sharepoint online? we have designer list workflow against sharepoint online site which is pretty big. when we try to save the workflow, we get above mentioned error. any way to change this property in SPO?

    • Abhay
      September 2, 2016 — 6:38 pm

      Hi Rohit
      I am encountering the same issue – have you been able to resolve your issue? any tips

  3. Thuan Soldier
    September 26, 2016 — 10:59 am

Leave a Reply

© 2018 The Soldier of Fortune.