您的位置:首页 > 编程语言 > ASP

ASP.NET上传大文件的问题

2016-01-06 17:50 639 查看
原文:http://www.cnblogs.com/wolf-sun/p/3657241.html?utm_source=tuicool&utm_medium=referral

引言

之前使用Uploadify做了一个上传图片并预览的功能,今天在项目中,要使用该插件上传大文件。之前弄过上传图片的demo,就使用该demo进行测试。可以查看我的这篇文章:[Asp.net]Uploadify所有配置说明,常见bug问题分析

大文件上传

第一步:修改web.config

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<!--maxRequestLength就是文件的最大字符数,最大值不能超过2个G左右,executionTimeout是超时时间-->
<httpRuntime targetFramework="4.5" maxRequestLength="1073741824" executionTimeout="3600" />
</system.web>
</configuration>


第三步:添加system.webServer节点

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<!--maxRequestLength就是文件的最大字符数,最大值不能超过2个G左右,executionTimeout是超时时间-->
<httpRuntime targetFramework="4.5" maxRequestLength="1073741824" executionTimeout="3600" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<!--修改服务器允许最大长度-->
<requestLimits maxAllowedContentLength="1073741824"/>
</requestFiltering>
</security>
</system.webServer>
</configuration>


设置IIS

打开IIS管理器,找到Default Web Site。先进行停止。



在IIS中双击“请求筛选”打开。



其中的允许的最大容量长度,默认是”30000000“,30M,将其修改为1073741824,即1G。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: