3

i am uploading an image ,when uploading image of a very large size the application crashes . i am checking the image size as well . but uploading image of a very large size bypass everything and crashes the application. What do u people suggest? what is the best practise?

2
  • 1
    Where does it crash? On a line of your code? A stack trace or some code may help. Commented Aug 23, 2010 at 5:11
  • it doesn't go on any line of code Commented Aug 23, 2010 at 6:18

1 Answer 1

4

ASP.NET's default max upload file size is 4MB. To upload larger files you need to add the following configuration in web.config file:

<system.web>
  <httpRuntime executionTimeout="240" maxRequestLength="10240" />
</system.web> 

This will set max file upload size to 10MB. You can also use it in location tag to apply the configuration only on specific directory.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.