Dear experts
I’m relative new to ASPX. I have a page on which a user could upload a file. I want to limit the user by type /image/ and by size (3 MB), but I want do this BEFORE the user post the file. I use a standard FileUpload control, not upload the file in additional page, I upload it on the main Submit button - look the page:
http://demo.asp2.eu/Register_bMA.aspx?langID=EN
I put a code in my Submit button for that purpose, but it look when the user select a big file the code AT all do not goes here – it get server error message. I want to stop user BEFORE he start uploading file with 200 MB by mistake /there is change for such mistake, no body read the message what should be uploaded here and it may start upload video file. /
if server error is coming then you have to change web.config file...
<configuration>
<system.web>
<httpRuntime maxRequestLength="SizeHere
</system.web>
</configuration>
"SizeHere" is in KB. The default is 4096 (= 4 MB).
Another solution is:
http://forums.asp.net/t/1099698.aspx
Hope this helps you.