如何解除IIS的文件上传限制

 时间:2026-02-15 18:33:24

1、首先

在IIS中右键“本地计算机”选择“属性”,钩选“允许直接编辑配置数据库”。

2、然后依次打开“控制面板--管理工具--服务”,在其中右边找到“IIS Admin Service”,选中该项并点击鼠标右键,选中“停止”即可关闭该服务。

3、修改C:/Windows/System32/inetsrv/config/schema/IIS_schema.xml文件(修改该文件需要获得这个文件的控制权),找到maxAllowedContentLength, 其默认值为30000000,即30M,加一个0 就变成了 300MB 了就应该够用了,如果不起作用,则需要重启 IIS 7!

修改之后如下:    

4、   <element name="requestLimits">           <attribute name="maxAllowedContentLength" type="uint" defaultValue="30000000" />           <attribute name="maxUrl" type="uint" defaultValue="4096" />          <attribute name="maxQueryString" type="uint" defaultValue="2048" />          <element name="headerLimits">          <collection addElement="add" clearElement="clear" removeElement="remove" >             <attribute name="header" type="string" required="true" isUniqueKey="true" validationType="nonEmptyString" />             <attribute name="sizeLimit" type="uint" required="true" />          </collection>      </element>

5、再修改web.config里面的

<add key="CookieTimeOut" value="30" />    <add key="imageSize" value="-1" />    <add key="fileSize" value="10000" />(大小改这里)    <add key="fileLimit" value="10" />

6、检查web.config的httpRuntime :

<httpRuntime maxRequestLength="2097151" executionTimeout="50000" />

  • 梦想城镇游戏里的热巧克力如何制作
  • PPT中的矩形有哪些妙用?
  • 电饼铛煎武昌鱼
  • 第43类商标群组有哪些?43类商标转让价格多少?
  • 航海王燃烧意志麦哲伦通关秘籍
  • 热门搜索
    怎么瘦肌肉型小腿 鼠标怎么拆 手机我的世界怎么联机 胸太小了该怎么办 台式电脑怎么调亮度 怎么打繁体字 bios怎么设置 ps怎么保存图片 心烦怎么办 我的世界铱矿怎么得