Posted on: 12/17/2014 7:14:19 AM | Views : 462

Hello
Behind my file upload page the code only allows .doc, .docx, .txt, .png, .gif, .bmp, .jpg, or .jpeg files to be uploaded and my Try/Catch 'traps' other files and displays a message on screen.
The code also allows files to be uploaded only if they are under 500Kb in size. I have applied the same logic here to that of the file extensions, but when I upload a file larger than 500Kb my Try/Catch does not trap the error. Instead, I get an error:
Server Error in '/' Application. --------------------------------------------------------------------------------
Maximum request length exceeded. System.Web.HttpException: Maximum request length exceeded.
This is my code:
Partial Class testSize Inherits System.Web.UI.Page Protected MaxSizeAllowed As Integer = 524288 Protected AllowedExtensions As String() = {".doc", ".docx", ".txt" ...

Go to the complete details ...