-1

50kb を超えるファイルを転送しようとすると、同じ問題が発生し、「(400) Bad Request」というエラー メッセージが表示されます。

誰かが私が間違っている場所を教えてもらえますか?

以下の次のコード:

 <?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
  <system.serviceModel> 


    <bindings> 
      <basicHttpBinding> 
        <binding name="BasicHttpBinding_IFileTransfer" closeTimeout="00:10:00" 
          openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" 
          messageEncoding="Text"  transferMode="Buffered" 
          useDefaultWebProxy="true"> 
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" 
            maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
          <security mode="None"> 
            <transport clientCredentialType="None" proxyCredentialType="None" 
              realm="" /> 
            <message clientCredentialType="UserName" algorithmSuite="Default" /> 
          </security> 
        </binding> 
      </basicHttpBinding> 
    </bindings> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> 
    <client> 

      <endpoint  address="http://localhost:57728/FileTransfer.svc" binding="basicHttpBinding" 
    bindingConfiguration="BasicHttpBinding_IFileTransfer" contract="WCFFileTransfer.IFileTransfer" 
    name="BasicHttpBinding_IFileTransfer" /> 

    </client> 


  </system.serviceModel> 
</configuration> 
4

1 に答える 1

0

サーバー上の web.config に次の設定があることを確認します。

<system.web>
    <httpRuntime maxRequestLength="2147483647" />
    ....
</system.web>
于 2012-09-12T19:43:51.767 に答える