File upload limit handleing

M

MS News \(MS ILM\)

Hello,

How do I handle a user uploading a file from the browser that exceeds the
limit set by
web or machine config files
global.asax or handlers or module

How can I return to the same upload page with some error to the user

Thanks

SAM
 
K

Karl

The only thing I know of is in the application's error event
(Application_Error method in global.asax), you should be able to check
Server.GetLastError().InnerException it should be of type HttpException
with a message "Maximum request length exceeded"... you could check for
that particular error, clear the error (server.ClearError()) and redirect
back to the input page with a value in the querystring to indicate the
error.

Karl
 
M

Marina

I think at the pt of the application error event, there would be no page
request to speak of, so I don't think you would be able to do this.
 
M

MS News \(MS ILM\)

Thank you all for your response.

It seems that I can not redirect,
It is not working for me
There is no page to response
I don't even get my custom error page.... which I don't really want any
way, but just tired it.

Thanks
 

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

Similar Threads

Image upload not working in browser 4
Upload XLSX file 8
File Upload Folder Permissions 5
File Upload Frustration 1
file upload size limit 1
HttpModule and file upload 0
A few file upload questions 5
Upload File 2

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top