首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >ASP.NET MVC中的文件大小上载限制: web.config(s)中的多个maxRequestLength设置

ASP.NET MVC中的文件大小上载限制: web.config(s)中的多个maxRequestLength设置
EN

Stack Overflow用户
提问于 2009-06-24 14:30:07
回答 1查看 21.8K关注 0票数 17

我希望有多个maxRequestLength文件大小上传限制的设置(例如,一个用于文件/新建,另一个用于图片/新建)。我的所有操作都需要额外的参数(例如/File/New?folderId=234)。

单个设置的效果与预期一致:

<httpRuntime executionTimeout="60" maxRequestLength="1024" />

我尝试在根web.config中有2个位置部分的2个设置,但没有成功。我不知道在“路径”中写什么--一个视图的物理aspx页面,或者controller+action……然而,似乎什么都不起作用。

<location path="/File/">
    <system.web>
        <httpRuntime executionTimeout="60" maxRequestLength="4096" />
    </system.web>
</location>
<location path="/Picture/">
    <system.web>
        <httpRuntime executionTimeout="60" maxRequestLength="1024" />
    </system.web>
</location>

我试着把另一个图片放在一个特定的视图文件夹中(例如/Views/ web.config /...),就像它在经典的Webform ASP.NET中一样,但这似乎也没有起到作用……

<location path="">
    <system.web>
        <httpRuntime executionTimeout="60" maxRequestLength="1024" />
    </system.web>
</location>

无论我做什么,只为httpRuntime.maxRequestLength应用一个值-在(根) web.config...system.web中。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1038742

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档