0

I have created a WCF REST in .net and I am unable to upload large files on server. When I test the things it will show me error on PostMan Client.

413 Request Too Large

I have changed the web settings. to this.

<webHttpBinding>
        <binding name="webHttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed">
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
          </security>
        </binding>
      </webHttpBinding>

This is me request stream.

Unable to paste my request stream.

Anil
  • 45
  • 6
  • have you looked at this? http://stackoverflow.com/questions/24048023/wcf-restfull-413-request-entity-too-large Probably a duplicate – Xeun Jul 14 '16 at 06:59
  • *Why did you removed this question http://stackoverflow.com/q/39340935/1679310 if I gave you really working answer?* – Radim Köhler Sep 06 '16 at 05:20

1 Answers1

0

A couple of things to check.

First, did you assign the "webHttpBinding" to an explicit endpoint? Something like this, in the <system.serviceModel> section:

<services>
  <service name="YourServiceName">
    <endpoint address="" binding="webHttpBinding"
              bindingConfiguration="webHttpBinding"
              contract="FullyQualified.IContractName" />
  </service>
</services>

Unless you assign the configuration "webHttpBinding" to an endpoint via the bindingConfiguration attribute, the default (smaller) values for webHttpBinding will be used.

Alternatively, you could make the configuration you specified the default for webHttpBinding by omitting the name attribute in the <binding> element.

Another thing to check is the maxRequestLength value in the <httpRuntime> element in your config file. You can specify a maximum value of 2147483647 (Int32.MaxValue, basically) in the <system.web> section of your config file, like this:

<system.web>
  <httpRuntime maxRequestLength="2147483647" />
</system.web>
Tim
  • 28,212
  • 8
  • 63
  • 76