System.Web.HttpException(0x80004005):上传文件时超出了最大请求长度 [英] System.Web.HttpException (0x80004005): Maximum request length exceeded while uploading file

查看:251
本文介绍了System.Web.HttpException(0x80004005):上传文件时超出了最大请求长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以通过在webconfig中增加maxRequestLength来解决它。但是我被限制这样做。



如果我上传大于5 MB的文件,我会收到此错误。





如果不改变web.config,请建议我任何替代方法。

I know it can be solved by increasing maxRequestLength in webconfig. but i am restricted to do so.

I am getting this error if i upload file greater then 5 MB.


Please suggest me any alternate way to do this without altering web.config.

推荐答案

在Machine.config中设置了默认的4MB最大请求长度,唯一可以覆盖它的方法是设置system.web - >适用于您的应用程序的web.config中的httpRuntime。



在IIS 7中尝试类似下面的内容



appcmd set config我的网站/ MyApp-section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost



来源 - http://weblogs.asp.net/jgalloway/archive/2008/01/08/large -file-uploads-in-asp-net.aspx [ ^ ]
There's a default of 4MB max request length set in Machine.config , The only way you can override this is set the system.web -> httpRuntime in web.config for your application.

Try something like below in IIS 7

appcmd set config "My Site/MyApp" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost

Source - http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx[^]


这篇关于System.Web.HttpException(0x80004005):上传文件时超出了最大请求长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆