0

I am uploading pdf of 26 MB but while uploading the pdf I am getting the following error

The remote server returned an unexpected response: (413) Request Entity Too Large.

PDF which I am trying to upload

my WCF web.config

<bindings>
  <basicHttpBinding>
    <binding maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Buffered"
    closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
      <readerQuotas maxDepth="2000000000"
      maxStringContentLength="2000000000"
      maxArrayLength="2000000000"
      maxBytesPerRead="2000000000"
      maxNameTableCharCount="2000000000" />
    </binding>
  </basicHttpBinding>
</bindings>

my web app web.config

<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IService" maxReceivedMessageSize="2147483647" />
  </basicHttpBinding>
</bindings>

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2147483647" />
  </requestFiltering>
</security>

The same code is working fine in local but when I published and hosted these changes into IIS I am getting the error

The remote server returned an unexpected response: (413) Request Entity Too Large.

I saw multiple questions and answers on stackoverflow but still not able to understand what is wrong

Ibrahim shaikh
  • 235
  • 2
  • 15

1 Answers1

1

I think you need to check the Service config.

Lan Huang
  • 613
  • 2
  • 5
  • which section of my service.config? – Ibrahim shaikh Nov 08 '21 at 06:34
  • You can check whether the endpoint is clearly defined in the config and assign your binding configuration to the `bindingConfiguration` attribute of the endpoint. ` ` Specific can refer to: https://stackoverflow.com/questions/20575946/the-remote-server-returned-an-unexpected-response-413-request-entity-too-larg – Lan Huang Nov 08 '21 at 08:08