How to upload content more than 2 MB’s on website created using asp.net 4.0

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?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

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

Method 2

add this to your web.config:

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

Method 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?


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x