maxRequestLength and FileUpload

J

Jay

I have been trying to use maxRequestLength to stop users from uploading
large files. It put this code in the web.config file:

<httpRuntime

maxRequestLength="128" />


--The upload works fine.
--When I select a large file I get the "Page cannot be displayed" message,
which is correct.

The problem is that I am trying redirect the user to a meaningful error
page or back to the upload page showing an error message. To do this I put
the code below in Page_Error or Application_Error. I have epxerimented with
both.

Server.ClearError()
Session("UPLOADERROR") = "yes"

Response.Redirect("ErrorPage.aspx")

No matter what I do I get the "Page cannot be displayed" messaage, rather
than being redirected. When this error message is displayed the URL in the
browser is showing update.aspx, not the error page.apsx. If I refresh I
get the Upload.aspx page. When I try to upload a large file and I set a
break point on Page_Error I can step to Reponse.redirect("ErrorPage.aspx")
but it does not redirect to ErrorPage.aspx.

I have also experimented with the web.config setting customErrors but I get
the same thing.

Help!!

Jay
 
J

Jay

Thanks.

I should have been more clear. First of all my upload page is the single
page in the Upload folder. I have defined a web.config file applicable
only for that folder with the maxRequestLength defined as shown below. All
other pages work fine. If I force another error (e.g., divide by zero) it
works.

In my reading some have suggested it is an IIS problem.

Jay
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top