Welcome 微信登录

首页 / 网页编程 / ASP.NET / Uploadify上传大文件以及Http error 404 解决方案

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

大文件上传

第一步:修改uploadify参数

1             "fileSizeLimit": "0",//单个文件大小,0为无限制,可接受KB,MB,GB等单位的字符串值

2             "fileTypeDesc": "文件",//文件描述Image Files

3             "fileTypeExts": "*.zip; *.rar; *.png",//允许上传的文件类型

测试,用一个大于30M的文件,进行上传测试。

第二步:修改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>
测试,仍然用上面的文件,进行上传测试: