so i am making a file upload. I have, in my web.config:
<httpRuntime executionTimeout="300" maxRequestLength="5120"/>
so the file can't exceed 5MB.
My server side code looks something like:
protected void button_Click(object sender, EventArgs e) {
try {if (fupCV.FileName != "") { DirectoryInfo di = new DirectoryInfo(Server.MapPath("CVs")); if (!di.Exists) di.Create(); fupCV.SaveAs(di.FullName + "/" + fupCV.FileName); //afterwards code } } catch (HttpException ex) { Response.Write(ex.Message); }}
and i can't catch the exception, i still get "Server Error in '/' Application."
Thanx for the help