简体   繁体   中英

WCF: request entity too large

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

我认为您需要检查服务配置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM