在IIS7.5上,如果通过WCF服务上传大文件(> 30MB),IIS服务器将会返回404.13错误,具体的错误信息如下:
HTTP Error 404.13 – Not Found
The request filtering module is configured to deny a request that exceeds the request content length.
解决方法是在web.config里把maxAllowedContentLength给设大些,默认最大智能上传28.6M的文件。
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength=”300000000″/>
</requestFiltering>
</security>
</system.webServer>
</configuration>
有的时候如果上传的是图片,即使图片本身不到28MB,但是由于同大小的thumbnails文件的存在,上传量有可能超过28M也会导致404.13错误。