2016-05-24 9 views
0

AJAXを使用して大容量ファイル2GBを送信すると、ASP.NetのWebサイトから悪い要求があります。HTTPエラー400 - AJAXを使用して大きなファイルをアップロードするときのリクエストが不正です

助けてください <httpRuntime maxRequestLength="2147483647" executionTimeout="3600"/>

を設定

マイHTTPランタイム。

のWeb.Config
`

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
    <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
    </configSections> 
    <connectionStrings> 
    <remove name="LocalSqlServer"/> 
    <add name="LocalSqlServer" connectionString="" providerName="System.Data.SqlClient"/> 
    <add name="psDevDataConnectionString1" connectionString="" providerName="System.Data.SqlClient"/> 
    </connectionStrings> 
    <system.web.extensions> 
    <scripting> 
     <webServices> 
     <jsonSerialization maxJsonLength="50000000" /> 
     </webServices> 
    </scripting> 
    </system.web.extensions> 
    <system.web> 
    <authentication mode="Forms"/> 
    <compilation debug="true" targetFramework="4.5"/> 
    <httpRuntime maxRequestLength="2147483647" executionTimeout="3600"/> 
    <membership defaultProvider="xplProvider"> 
     <providers> 
     <add name="xplProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="10" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/> 
     </providers> 
    </membership> 
    <webServices> 
     <protocols> 
     <add name="HttpGet"/> 
     <add name="HttpPost"/> 
     </protocols> 
    </webServices> 
    <customErrors mode="RemoteOnly" defaultRedirect="~/sysError.aspx"> 
     <error statusCode="404" redirect="~/infoCollector.aspx"/> 
    </customErrors> 
    <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="Static"/> 
    </system.web> 
    <system.webServer> 
    <handlers> 
     <add name="DocImage" verb="GET,POST" path="DocImage.axd" type="DotnetDaddy.DocumentViewer.DocImageHandler, DocumentViewer"/> 
     <add name="pngs" verb="*" path="ClientPortals/images/*" type="Project.UserInterface.ClientPortals.image" preCondition="managedHandler"/> 
    </handlers> 
    <modules> 
     <add name="UploadModule" type="RTE.UploadModule,RichTextEditor"/> 
     <add name="CuteEditor.UploadModule" type="CuteEditor.UploadModule,CuteEditor"/> 
    </modules> 
    <httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL"> 
     <remove statusCode="404"/> 
     <error statusCode="404" path="/scenter.aspx" responseMode="ExecuteURL"/> 
    </httpErrors> 
    <security> 
     <requestFiltering> 
     <requestLimits maxAllowedContentLength="4294967296"/> 
     </requestFiltering> 
    </security> 
    </system.webServer> 
    <appSettings> 
    <add key="PageInspector:ServerCodeMappingSupport" value="Disabled"/> 
    </appSettings> 
    <system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="ServiceSoap"> 
      <security mode="Transport"/> 
     </binding> 
     <binding name="ServiceSoap1"/> 
     <binding name="sms2SOAPbasicHttpBinding"/> 
     <binding name="sms2SOAPbasicHttpsBinding"> 
      <security mode="Transport"/> 
     </binding> 
     </basicHttpBinding> 
     <wsHttpBinding> 
     <binding name="sms2wsHttpBinding"> 
      <security mode="None"/> 
     </binding> 
     <binding name="sms2wsHttpBindingSecure"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None"/> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://api.authorize.net/soap/v1/Service.asmx" binding="basicHttpBinding" bindingConfiguration="ServiceSoap" contract="ArbApiSoap.ServiceSoap" name="ServiceSoap"/> 
     <endpoint address="http://sms2.cdyne.com/sms.svc/Soap" binding="basicHttpBinding" bindingConfiguration="sms2SOAPbasicHttpBinding" contract="cdyneSMS.Isms" name="sms2SOAPbasicHttpBinding"/> 
     <endpoint address="https://sms2.cdyne.com/sms.svc/SecureSoap" binding="basicHttpBinding" bindingConfiguration="sms2SOAPbasicHttpsBinding" contract="cdyneSMS.Isms" name="sms2SOAPbasicHttpsBinding"/> 
     <endpoint address="http://sms2.cdyne.com/sms.svc/WS" binding="wsHttpBinding" bindingConfiguration="sms2wsHttpBinding" contract="cdyneSMS.Isms" name="sms2wsHttpBinding"/> 
     <endpoint address="https://sms2.cdyne.com/sms.svc/WS" binding="wsHttpBinding" bindingConfiguration="sms2wsHttpBindingSecure" contract="cdyneSMS.Isms" name="sms2wsHttpBindingSecure"/> 
    </client> 
    </system.serviceModel> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/> 
     <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="AWSSDK" publicKeyToken="9f476d3089b52be3" culture="neutral"/> 
     <bindingRedirect oldVersion="0.0.0.0-2.3.55.0" newVersion="2.3.55.0"/> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
    <microsoft.web.services3> 
    <messaging> 
     <executionTimeoutInSeconds value="300" /> 
     <maxMessageLength value="524288000" /> 
    </messaging> 
    </microsoft.web.services3> 
</configuration> 

`

答えて

2

maxRequestLengthキロバイトであるので2147483647キロバイトをバイトではないたくさんだと約2000 GBです。 2GB = 2097152 KBそれを2097152に変更してください。

一方、maxAllowedContentLengthはバイトです。

これらの値をweb.configに配置することをお勧めします。

maxRequestLengthは、ASP.NETでサポートされる最大ファイルアップロードサイズを示します。maxAllowedContentLengthは、IISでサポートされている要求のコンテンツの最大長を指定します。したがって、大きなファイルをアップロードするにはmaxRequestLengthとmaxAllowedContentLengthの両方の値を設定する必要があります。

<system.web> 
    <httpRuntime maxRequestLength="2097152" executionTimeout="3600"/> 
</system.web> 
<system.webServer> 
    <security> 
     <requestFiltering> 
      <requestLimits maxAllowedContentLength="2147483648" /> 
     </requestFiltering> 
    </security> 
</system.webServer> 
+0

おかげロナウジーニョsuggetion ためではなく、タグをrequestFiltering追加した後、私はいつもあなたのweb.configファイルのコードを投稿することができ500 – pawanplus

+0

を取得していますか? –

+0

投稿にConfigファイルを追加しました。助けてください – pawanplus

関連する問題