cancel POST request


P

Pavel Dvorkin

Hi All,

I have next problem.

A page contains HtmlInputFile. User tries to upload file. File size is
too large, so I can't allow this request.

Now I have DNS error accoeding to MSDN

When uploading large files, use the maxRequestLength attribute of the
<httpRuntime> element to increase the maximum allowable file size. A DNS
error is generated in the browser when the file exceeds the specified size.

I want simply intercept this situation and redirect user to a special
error page, no more. In other words, I want to cancel this POST request
and force IIS to do a GET request to a special aspx page.

But I couldn't. I get only event BeginRequest in global.asax.vb. I tried
to user Redirect, RewritePath but without success. As for Page_Init,
Page_Load - I even do not got them.

How can I do it ?
 
Ad

Advertisements

P

Patrice

Double check the call stack but If I remember this exception is triggered
before your own code runs... If yes, the simplest solution could be to test
the content length in your global error handler to suggest the user to try
again with a smaller file...
 
P

Pavel Dvorkin

Patrice said:
Double check the call stack but If I remember this exception is triggered
before your own code runs... If yes, the simplest solution could be to test
the content length in your global error handler to suggest the user to try
again with a smaller file...

At Application_Error ? Unfortunately, it doesnt' occur at this case. And
I have no exception. I simpy have a browser winodw with

The page cannot be displayed
 
Ad

Advertisements

P

Pavel Dvorkin

Patrice said:
Double check the call stack but If I remember this exception is triggered
before your own code runs... If yes, the simplest solution could be to test
the content length in your global error handler to suggest the user to try
again with a smaller file...

At Application_Error ? Unfortunately, it doesn't occur at this case. And
I have no exception. I simpy have a browser window with

The page cannot be displayed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top