ASP.Net 上传达文件设置
来源:互联网 发布:淘宝颜色选择图片尺寸 编辑:程序博客网 时间:2024/04/20 15:09
(转自 http://www.cnblogs.com/xgbzsc/archive/2012/07/27/2611140.html)
第一步:修改IIS设置,允许直接编辑配置数据库教程,如下图所示:
第二步:先在服务里关闭iis admin service服务
找到windows/system32/inesrv下的metabase.xml,
打开,找到ASPMaxRequestEntityAllowed 把他修改为需要的值,默认为204800,即200K 把它修改为你所需的大小即可。如:51200000(50M)
然后重启iis admin service服务。
2.iis7
解决办法:
修改IIS_schema.xml这个文件要先获得这个文件的控制权;
进入目录C:\Windows\System32\inetsrv\config\schema,修改文件IIS_schema.xml 权限:
进入IIS_schema.xml文件权限修改,选择”高级”
选择”所有者”
选中 administrators 确定
再进入权限编辑,修改administrators 完全控制.
再去掉IIS_schema.xml的只读属性.
修改文件配置:
然后搜索 3000000 意思是 只允许上传 30MB 大小的文件,你在这后面多加一个0 就变成了 300MB 了就应该够用了。然后重启 IIS 7
<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>
<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>
最后maxRequestLength我还是也做了对应的修改。使程序不限制request最大长度。完美解决。
- ASP.Net 上传达文件设置
- ASP.NET应用程序设置文件
- asp.net图片下载的文件头设置
- 设置ASP.NET 上传文件的大小:
- asp.net 文件下载,报文头设置
- Asp.Net文件上传之简单文件上传(上)
- asp.net web上的设置回车按钮
- asp.net 实现下载服务器上的文件
- 利用ASP.NET设计FTP文件上传(上)
- 利用ASP.NET设计FTP文件上传(上)
- Asp.net(c#)取ftp上 文件信息
- asp.net 文件上傳受限大小問題
- 在UpdatePanel上使用FileUpload上传文件 (asp.net C#)
- 如何设置用ASP.NET上传大文件问题
- 在 ASP.NET 中设置 html 文件的访问验证
- ASP.NET大文件上传设置maxRequestLength无效的情况
- ASP.NET大文件上传设置。maxRequestLength无效的情况
- 在ASP.NET中设置html文件的访问验证
- centos6 yum安装nginx、php-fpm
- opengl es 纹理压缩
- 各种字符串Hash函数比较
- Vim常用命令
- MapReduce错误任务失败处理
- ASP.Net 上传达文件设置
- HDU 1520 Anniversary party树状DP
- android 使用SurfaceView实现小球高处落下并弹起的效果
- 第三次作业
- linux查看硬件配置的命令
- TCP协议三次握手过程分析
- ViewConfiguration的简单介绍
- android TextView实现跑马灯效果
- WebUtil Useful Reference