How to upload content more than 2 MB's on website created using asp.net 4.0 [duplicate]

北慕城南 提交于 2019-11-28 12:46:27

问题


Possible Duplicate:
How to increase the max upload file size in ASP.NET?

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."

is there and why to increase the limit in asp.net web.config file?


回答1:


If you are trying to upload a file, set this to Web.Config under system.web section

  <httpRuntime maxRequestLength="51200" executionTimeout="3600" />

where maxRequestLength is the file size limit in KB and executionTimeout is the timeout in seconds. Set this value as per the requirement.




回答2:


add this to your web.config:

<configuration>
  <system.web>
    <httpRuntime maxRequestLength="xxx" />
  </system.web>
</configuration>



回答3:


You can control the max upload size in asp.net by editing the maxRequestLength attribute in the web.config

How to increase the max upload file size in ASP.NET?



来源:https://stackoverflow.com/questions/7804622/how-to-upload-content-more-than-2-mbs-on-website-created-using-asp-net-4-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!