首页 > 系统相关 >Windows中IIS7设置上传文件大小限制

Windows中IIS7设置上传文件大小限制

时间:2023-01-04 14:03:58浏览次数:46  
标签:文件大小 IIS Windows IIS7 error applicationhost Line config 节点

IIS 7 默认文件上传大小时限制30M。
要突破这个限制:
1.  修改IIS的applicationhost.config

Windows中IIS7设置上传文件大小限制_IIS

打开 %windir%\system32\inetsrv\config\applicationhost.config
找到:<requestFiltering>节点,这个节点默认没有 <requestLimits maxAllowedCnotallow="上传大小的值(单位:byte)" /> 元素,IIS 7和IIS 7.5上测试过  最大值只能是<requestLimits maxAllowedCnotallow="4294967295" />  <4GB,
为这个节点新增如下事例元素:<requestLimits maxAllowedCnotallow="2147483647" /> ,上传的大小将改为2G。

Windows中IIS7设置上传文件大小限制_IIS_02

注意: %windir%\system32\inetsrv\config\applicationhost.config 文件一定不要用其他机器的文件替换,否则IIS将无法启动。备份的config文件也不要放在同一目录下。

此文件记录了,当前IIS中所有Site , App pool的信息,还有一些与机器相关的配置。
2 修改web.config
<system.web>
<httpRuntime executinotallow="36000" maxRequestLength="2097151"/>   <!--maxRequestLength:上传的大小,单位K   ,executionTimeout:设置超时时间,单位:秒。(默认是90秒) -->
</system.web>
注意:这个maxRequestLength最大值只能是2097151K,设置大于这个值将会出现如下错误:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The value for the property 'maxRequestLength' is not valid. The error is: The value must be inside the range 0-2097151.
Source Error:
Line 101:    <httpHandlers />
Line 102:    <customErrors mode="RemoteOnly" />
Line 103:    <httpRuntime executinotallow="36000" maxRequestLength="4194304" />
Line 104:    <authentication mode="Windows" />
Line 105:    <identity impersnotallow="true" />
3.  web.config下如果有如下节点(此节点是为IIS 7设计的) ,则修改
<requestLimits maxAllowedCnotallow="2147483647" /> 单位与applicationhost.config中的<requestLimits maxAllowedCnotallow="2147483647" />一致,它的最大值也只能为4294967295
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedCnotallow="2147483647" />
</requestFiltering>
</security>
</system.webServer>

标签:文件大小,IIS,Windows,IIS7,error,applicationhost,Line,config,节点
From: https://blog.51cto.com/kele/5988343

相关文章

  • Windows xp 64 bit
    WindowsXPProfessionalx64EditionwithSP2-VL(English) 详细信息文件名en_win_xp_pro_x64_with_sp2_vl_X13-41611.isoSHA1CD9479E1DBAD7F26B8BDCF97E4AA71CBB8DE......
  • windows自动开关机命令
    Windows系统自带了一个名为shutdown.exe的程序,这个程序默认是在C:WindowsSystem32这个文件夹下面,一般情况下Windows系统的关机都可以通过调用程序shutdown.exe来实现的,同时......
  • postgresql windows 开发环境搭建
    postgresqlwindows开发环境搭建发布时间:2020-06-2912:45:05 来源:网络 阅读:2883 作者:pgmia 栏目:数据库一、软件需求Windows7旗舰版sp1X64ActivePerl-5.......
  • Windows下用VS2022编译安装Boost库
    Windows下用VS2022编译安装Boost库下载地址:https://www.boost.org/users/download/解压得到如下文件:  编译安装:打开vs2022命令行工具  切换到boost的目......
  • 【拓展】745- Windows Server 升级 HTTPS 实战
    趁着国庆假期,开发了个小程序,但需要服务器使用HTTPS协议,因此借这次机会,学着自己完成HTTPS升级工作。如有什么错误,欢迎指正!......
  • Game——Fix the “You’ll Need a New App to Open This Ms-Gamingoverlay” Error o
    参考链接win11我用的方法6解决。......
  • windows配置supervisor实现nginx自启
    前言有些老项目的nginx部署在windowsserver上,而且服务器比较老旧,经常异常重启。鉴于个人并不熟悉windowsserver,因此配置supervisor自启nginx,实现windows开机自启supervi......
  • 安装windows 11要求联网和登录微软账户
    假如碰到要求联网和登录微软账户,那我们可以先拔掉网线,接着按下组合快捷键【Shift+F10】打开运行窗口,在框内输入命令【oobe\BypassNRO.cmd】,最后回车即可。就这样,我们就能够......
  • 华为笔记本电脑快捷键无法使用的解决方法(适用windows10(11))
    请先确认F1至F12的按键是否正常。例如可以打开IE浏览器,按下F5,确认是否出现以下场景:如果可以刷新浏览器,说明按键对应的功能键正常。点击键盘上的Fn键,即激活F1~F12......
  • windows下启动redis
    首先下载安装redis省略1、找到redis的安装目录,一般在C盘的programfiles文件夹下,进入redis文件夹2、打开命令行窗口,输入redis-server.exeredis.windows.conf3、......