Why Does an Error Occur When I Upload a Large File in SharePoint?
Symptoms
When I upload a large file in SharePoint, usually larger than 2 MB, this error message shows:
The request message is too large. The server does not allow messages that are larger than 2097152 bytes.
Cause
The default upload limit of SharePoint CSOM is 2 MB.
Prerequisites
Resolution
- Use a PowerShell script to increase the upload limit in SharePoint.
Format:
$ws = [Microsoft.SharePoint.Administration.SPWebService]::ContentService $ws.ClientRequestServiceSettings.MaxReceivedMessageSize = {file size in bytes} $ws.ClientRequestServiceSettings.MaxParseMessageSize = {file size in bytes} $ws.Update()
Example:
$ws = [Microsoft.SharePoint.Administration.SPWebService]::ContentService $ws.ClientRequestServiceSettings.MaxReceivedMessageSize = 2147483647 $ws.ClientRequestServiceSettings.MaxParseMessageSize = 2147483647 $ws.Update()
More Information
https://msdn.microsoft.com/en-us/library/office/ff599489(v=office.14)