2016-05-24 9 views
0

Ich erhalte eine schlechte Anfrage von der ASP.Net-Website beim Senden der großen Datei 2 GB mit AJAX.HTTP-Fehler 400 - Schlechte Anforderung beim Hochladen großer Dateien mit AJAX

Meine HTTP-Laufzeiteinstellung <httpRuntime maxRequestLength="2147483647" executionTimeout="3600"/>

Bitte helfen.

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> 

`

Antwort

2

maxRequestLength ist in Kilobyte nicht Byte so 2147483647 Kilobyte ist etwa 2000 GB, das ist eine Menge. 2 GB = 2097152 KB. Versuchen Sie, es zu ändern 2097152

Auf der anderen Seite ist maxAllowedContentLength in Bytes.

Es wird empfohlen, beide Werte in web.config zu speichern.

Die maxRequestLength-Datei gibt die maximale Dateiuploadgröße an, die von ASP.NET unterstützt wird. MaxAllowedContentLength gibt die maximale Länge des Inhalts in einer von IIS unterstützten Anforderung an. Daher müssen die Werte maxRequestLength und maxAllowedContentLength zum Hochladen großer Dateien festgelegt werden.

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

Dank Ronaldinho für suggetion Aber nach request Tag hinzufügen, ich bin immer 500 bekommen – pawanplus

+0

können Sie Ihre web.config Code posten? –

+0

Konfigurationsdatei im Post hinzugefügt. Bitte helfen Sie – pawanplus