title: The remote server returned an error: (413) Request Entity Too Large
body: <p>I know this is a redundant question, I am getting the error while I am uploading the a file which is more than 100 KB. </p>
  
  <blockquote>
    <p>The remote server returned an error: (413) Request Entity Too Large.</p>
  </blockquote>
  
  <p>I am posting the content to a WCF Service (64 bit environment). Am aware this should have been resolved with managing maxReceivedMessageSize and relevant behaviours but unfortunately its not.</p>
  
  <p>Below is my configurations :-</p>
  
  <p><strong>Client</strong></p>
  
  <pre><code>     &lt;binding allowCookies="false" bypassProxyOnLocal="false" closeTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" name="BasicHttpBinding_ICandidateManagementService" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:11:00" textEncoding="utf-8" transferMode="Streamed" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
             maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
            &lt;security mode="None"&gt;
            &lt;transport clientCredentialType="None" proxyCredentialType="None" realm=""/&gt;
              &lt;message algorithmSuite="Default" clientCredentialType="UserName"/&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
  
   &lt;behavior name="CandidateBehavior"&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="2147483647" /&gt;
          &lt;/behavior&gt;
  
  &lt;endpoint address="http://localhost:62368/CandidateManagementService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICandidateManagementService" contract="MMJ.ServiceContracts.ServiceContract.ICandidateManagementService" name="BasicHttpBinding_ICandidateManagementService" behaviorConfiguration="CandidateBehavior" /&gt;
  </code></pre>
  
  <p><strong>Service</strong></p>
  
  <pre><code>&lt;services&gt;
        &lt;service name="BasicHttpBinding_ICandidateManagementService" behaviorConfiguration="CandidateBehavior"&gt;
          &lt;endpoint contract="MMJ.ServiceContracts.ServiceContract.ICandidateManagementService" binding="basicHttpBinding" address="" bindingConfiguration="BasicHttpBinding_ICandidateManagementService"/&gt;
        &lt;/service&gt;
  </code></pre>
  
  <p>I have seen possibly everything available and still cant solve this issue. have also tried using below configuration, but still no change...</p>
  
  <pre><code>&lt;serverRuntime uploadReadAheadSize="500000000" maxRequestEntityAllowed="500000000"/&gt;
  </code></pre>
  
  <p>Kindly help!</p>
  
  <p><strong>Service binding Config</strong> (its same as client)</p>
  
  <pre><code>&lt;binding allowCookies="false" bypassProxyOnLocal="false" closeTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" name="BasicHttpBinding_ICandidateManagementService" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:11:00" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="32" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm=""/&gt;
              &lt;message algorithmSuite="Default" clientCredentialType="UserName"/&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
  </code></pre>
  
  <hr>
  
  <p>To give more insight below is the fiddlers finding :-</p>
  
  <blockquote>
    <p>Request Count:   1 Bytes Sent:      85,719        (headers:697; body:85,022)
    Bytes Received:  10,129       (headers:254; body:9,875)</p>
  </blockquote>