This post has been republished via RSS; it originally appeared at: IIS Support Blog articles.
While trying to upload files that are bigger than 64 KB, we came across this error: 413 Request Entity Too Large.
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize
property on the appropriate binding element.
As the error above mentions, this issue occurs because the request size is bigger than the MaxReceivedMessageSize
for WCF.
Solution
Increase MaxReceivedMessageSize
value for your web service to solve this issue. However, this may get tricky because there are two different MaxReceivedMessageSize
parameters:
- MaxReceivedMessageSize in System.ServiceModel.Configuration.BasicHttpBindingElement
- MaxReceivedMessageSize in System.ServiceModel.Channels.HttpTransportBindingElement
This configuration below will increase the MaxReceivedMessageSize
in System.ServiceModel.Configuration.BasicHttpBindingElement
You should increase the MaxReceivedMessageSize
in System.ServiceModel.Channels.HttpTransportBindingElement as well:
You can also do it in the code as explained in this document.