views:

36

answers:

1

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  A: 

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.

Branislav Abadjimarinov