Adding the belwo tag solved my problem of uploading the file more than 4 MB of size.
< system.web>
<httpRuntime maxRequestLength="65536" />
< /system.web>
However just for testing purpose I tried uploading file more than 20 MB of size.
The test failed :( and the new exception I got was
"There was no endpoint at XXX that could accept the message. This is often caused by an incorrect address or SOAP action"
My Service bindings was as below
<binding name="My_Binding" closeTimeout="00:10:00" openTimeout="00:10:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
Also I had <httpRuntime maxRequestLength="65536" /> in web.config
Googling through several article, finally I found a solution. Adding the below tag in my WCF Service help me to upload document more than 20 MB of size
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="204800000" />
</requestFiltering>
</security>
</system.webServer>
< system.web>
<httpRuntime maxRequestLength="65536" />
< /system.web>
However just for testing purpose I tried uploading file more than 20 MB of size.
The test failed :( and the new exception I got was
"There was no endpoint at XXX that could accept the message. This is often caused by an incorrect address or SOAP action"
My Service bindings was as below
<binding name="My_Binding" closeTimeout="00:10:00" openTimeout="00:10:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
Also I had <httpRuntime maxRequestLength="65536" /> in web.config
Googling through several article, finally I found a solution. Adding the below tag in my WCF Service help me to upload document more than 20 MB of size
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="204800000" />
</requestFiltering>
</security>
</system.webServer>
No comments:
Post a Comment