问题描述
可能重复:
如何在 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 的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)