【问题标题】:UploadReadaheadsize value chenged but that not solved Request Entity too large errorUploadReadaheadsize 值已更改,但未解决 Request Entity too large 错误
【发布时间】:2017-11-20 03:38:48
【问题描述】:

我想通过位于 IIS 服务器中的 WCF 服务上传照片。 但我收到“请求实体太大错误 413”。

我已更改配置编辑器中的 UploadReadaheadsize 值和 web.config 中的 maxReceivedMessageSize 值,但这并没有解决我的问题。

同时,当我在 Visual Studio 中运行服务时,上传照片确实成功。

谁能帮帮我?

【问题讨论】:

    标签: c# wcf iis


    【解决方案1】:

    将此代码添加到 app.config。

    <bindings>
      <webHttpBinding >
        <binding name="Binding"     maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Streamed">
          <!--<security mode="Transport">
            <transport clientCredentialType="None" />
          </security>-->
        </binding>
        <binding name="httpbind" crossDomainScriptAccessEnabled="true" maxReceivedMessageSize="10485760">
        </binding>
      </webHttpBinding>
      <basicHttpBinding>
        <binding maxReceivedMessageSize="10485760">
          <!--<readerQuotas ...="" />-->
        </binding>
      </basicHttpBinding>
    </bindings>
    

    记得在下面的代码中添加服务标签。

    <endpoint behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="Binding" name="Android" contract="com.Order.Service.IService" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-17
      • 2013-08-09
      • 1970-01-01
      • 2020-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多