0

我知道这个问题已被多次提出,但每个代码都有不同的答案。我正在尝试将大于 50K 的文件上传到我的 Web 服务流。下面是我的配置,我尝试了一切,但我仍然收到 400 Bad request。有任何想法吗 ??

<?xml version="1.0"?>
<configuration>
    <system.net>
        <defaultProxy>
            <proxy
            usesystemdefault = "false"
            proxyaddress="Address"
            bypassonlocal="false"/>
        </defaultProxy>
    </system.net>
    <connectionStrings>

    </connectionStrings>
    <appSettings>


    </appSettings>
    <system.web>
        <compilation targetFramework="4.0" debug="true" />
        <authentication mode="None"/>
        <httpRuntime maxRequestLength="64000000"/>
    </system.web>

    <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
        </serviceHostingEnvironment>
        <standardEndpoints>
            <webHttpEndpoint>
                <standardEndpoint name="" helpEnabled="true" crossDomainScriptAccessEnabled="true" automaticFormatSelectionEnabled="true" />
            </webHttpEndpoint>
        </standardEndpoints>
        <behaviors>
            <endpointBehaviors>
                <behavior name="webHttpBehavior">
                    <webHttp />
                </behavior>
            </endpointBehaviors>
        </behaviors>
        <bindings>

            <webHttpBinding>
                <binding name="webHttpBindingWithJsonP" crossDomainScriptAccessEnabled="true" />

            </webHttpBinding>
            <basicHttpBinding>
                <binding maxBufferSize="64000000" maxReceivedMessageSize="64000000" maxBufferPoolSize="64000000">
                    <readerQuotas maxDepth="64000000" maxStringContentLength="64000000" maxArrayLength="64000000" maxBytesPerRead="64000000" />
                    <security mode="None"/>
                </binding>
            </basicHttpBinding>
        </bindings>

        <services>
            <service name="myService">
                <endpoint address="" binding="webHttpBinding"
                          bindingConfiguration="webHttpBindingWithJsonP" contract="IAllatusService"
                          behaviorConfiguration="webHttpBehavior"/>
            </service>
        </services>

    </system.serviceModel>


    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
    </system.webServer>
</configuration>
4

0 回答 0