Connecting Tech Pros Worldwide Forums | Help | Site Map

Checking file upload size

Vicky
Guest
 
Posts: n/a
#1: Nov 18 '05
i have specified 10000 kbytes iin maxrequestlength , now if a file having
size more than the limit is selected and upload button is pressed then page
not found error comes.
How to check file size and restrict user before this error occurs

Vicky



Avneesh
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Checking file upload size


By default ASP.NET has a limits of file upload size equals to 4Mb approx.
This is implemented to prevent denial of service attacks ( smebody try to bring down the server by uploading massive files).

To enable support for larger files, you should add following configuration setting value to your application ( machine's web.config file):

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

Replace 4096 with higher value.

Hope this helps.

Avneesh
MCAD, MCSD.Net


Closed Thread