web上传大文件的配置

时间:2023-03-10 03:53:28
web上传大文件的配置

1、项目本身的webconfig  在<system.web>字段下

<httpRuntime targetFramework="4.5" requestLengthDiskThreshold="256" maxRequestLength="1000000000" executionTimeout="120"/>

2、找到C:\Windows\System32\inetsrv\config\schema下(我的是window7)IIS_schema.xml文件下面的字节

<attribute name="maxAllowedContentLength" type="uint"
defaultValue="30000000" /> 默认是30m   可以在后面加个0

如果这个文件更改有权限限制,则

下面我们就来看下如何修改IIS_schema.xml文件的权限:

  1. 在路径"C:\Windows\System32\inetsrv\config\schema"中找到IIS_schema.xml文件;

web上传大文件的配置

  1. 点击IIS_schema,右键选择properties,在打开的窗口页面中选择Security
    Tab,点击Advanced button;

web上传大文件的配置

  1. 在弹出的Advanced Security Settings页面,点击Owner
    Tab,点击下面Edit Button;

web上传大文件的配置

  1. 在编辑页面,填入要执行操作的user,点击apply;

web上传大文件的配置

  1. 并给予此User Full Control权限;

web上传大文件的配置

  1. 在General Tab中去掉Read-only选项的勾选,点击OK保存。

web上传大文件的配置

  1. 之后就可以用设置的用户打开IIS_schema.xml文件进行编辑。

3、这一步估计不是必须:iis中点击网站》请求筛选 右边“编辑功能设置” 》“允许最大内容长度” 补个0    这里的数字以b为单位  1m=1024kb=1024*1024b