I have a simple webmethod
[WebMethod]
public int myWebMethod(string fileName, Byte[] fileContent)
However, whenever I pass a byte array which is larger than 30mb, I get the error:
HTTP Error 404.13 - Not Found The request filtering module is configured to deny a request that exceeds the request content length.
My web.config is as follows:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"> </compilation>
<authentication mode="Windows" />
<httpRuntime useFullyQualifiedRedirectUrl="true"
maxRequestLength="102400" requestLengthDiskThreshold="102400"
/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600"/>
</requestFiltering>
</security>
</system.webServer>
</configuration>
I've searched around, and the most common cause of this problem is the maxAllowedContentLength
property being 30mb by default. However, I have set this to be 100mb, as well as the maxRequestLength
property for httpRuntime
.
I can't find a solution anywhere which isn't setting one of the properties I've already tried above. Is there something I have missed?