How to upload content more than 2 MB#39;s on website created using asp.net 4.0(如何在使用 asp.net 4.0 创建的网站上上传超过 2 MB 的内容)
问题描述
可能重复:
如何在 ASP 中增加最大上传文件大小.NET?
我正在尝试验证用户上传的上传内容,如果我们上传小于 2 MB 的内容,它可以正常工作,但如果我们上传大于 2 MB 的内容,我们会收到错误连接已重置".
i m trying to validate an uploaded content uploaded by user, it works fine if we upload content lesser than 2 MB's, but if we upload content more than 2MB's, withour undergoing any process, we get an error "Connection is reset."
是否存在以及为什么要增加 asp.net web.config 文件中的限制?
is there and why to increase the limit in asp.net web.config file?
推荐答案
如果您要上传文件,请将其设置为 system.web 部分下的 Web.Config
If you are trying to upload a file, set this to Web.Config under system.web section
<httpRuntime maxRequestLength="51200" executionTimeout="3600" />
其中 maxRequestLength 是以 KB 为单位的文件大小限制,而 executionTimeout 是以秒为单位的超时.根据需求设置此值.
where maxRequestLength is the file size limit in KB and executionTimeout is the timeout in seconds. Set this value as per the requirement.
这篇关于如何在使用 asp.net 4.0 创建的网站上上传超过 2 MB 的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在使用 asp.net 4.0 创建的网站上上传超过 2
基础教程推荐
- JSON.NET 中基于属性的类型解析 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
