① 如何设置服务器iis上传文件大小
在IIS 6.0中设置文件上传大小的方法,就是配置如下节点:
复制代码 代码如下:
<system.web>
<httpRuntime maxRequestLength="1048576" executionTimeout="600"/>
</system.web>
但在IIS7中,设置如上设置后,不管设置多大数值,最大上传了限制为30M
还要进行如下设置才能正确:
方法1:
appcmd set config "My Site/MyApp" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost
在IIS服务器的命令行执行如上命令,注意修改上面的网站名称和上传文件大小
方法2:
在web.config中加入如下配置:
复制代码 代码如下:
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1048576000"></requestLimits>
</requestFiltering>
</security>
</system.webServer>
② 怎么修改iis最大上传文件大小
IIS7.0默认限制上传文件大小为30000000字节(约28.6M)。打开C:\Windows\System32\inetsrv\config\schema\IIS_schema.xml,找到如下内容:
<element name="requestLimits">
<attribute name="maxAllowedContentLength" type="uint" defaultValue="30000000" />
<attribute name="maxUrl" type="uint" defaultValue="4096" />
...
③ 如何解除IIS的文件上传限制
解除IIS的文件上传限制的方法如下:
编辑IIS配置数据库:
停止IIS Admin Service服务:
修改IIS_schema.xml文件:
修改web.config文件:
重启IIS服务:
注意:在修改这些配置文件之前,请确保你有足够的权限,并且已经备份了相关文件,以防修改过程中出现意外情况导致服务中断。