如何测量webconfig maxRequestLength中的属性 [英] How is the property in webconfig maxRequestLength measured

查看:32
本文介绍了如何测量webconfig maxRequestLength中的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想增加这个值

 <httpRuntime maxRequestLength="2024000" executionTimeout="300"/>

但是我不确定如何测量它,MB,KB?没有把握.我希望能够接受最大50 MB的请求.

But i am not sure how it is measured, MB, KB? not sure. I would like to be able to accept requests up to 50 MB.

致谢

推荐答案

属性 maxRequestLength 表示ASP.NET支持的最大文件上传大小.此限制可用于防止由于用户将大文件发布到服务器而导致的拒绝服务攻击.指定的大小以千字节为单位.默认值为4096 KB(4 MB). MSDN

The property maxRequestLength indicates the maximum file upload size supported by ASP.NET. This limit can be used to prevent denial of service attacks caused by users posting large files to the server. The size specified is in kilobytes. The default is 4096 KB (4 MB). MSDN

对于50 MB,您需要将其设置为51200.

For 50 MB you will need to set it to 51200.

<httpRuntime maxRequestLength="51200" executionTimeout="300"/>

编辑基于评论

OP不会询问执行超时,但@barnes在下面的注释中做了询问.我想添加有关 executionTimeout 的一些详细信息以及其他 httpRuntime 属性.

The OP does not ask about executionTimeout but @barnes did in comments below. I feel to add some details about executionTimeout as well which is other httpRuntime attribute.

executionTimeout :

可选的TimeSpan属性.指定允许请求执行的最大秒数>在自动关闭之前由ASP.NET下载.仅当debug属性位于编译元素为False.为了防止关机您正在调试的应用程序时,请勿将此超时设置为很大的价值.默认值为"00:01:50"(110秒), 查看全文

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