Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > File upload limit handleing

Reply
Thread Tools

File upload limit handleing

 
 
MS News \(MS ILM\)
Guest
Posts: n/a
 
      08-18-2004
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


 
Reply With Quote
 
 
 
 
Karl
Guest
Posts: n/a
 
      08-18-2004
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


"MS News (MS ILM)" <> wrote in message
news:%...
> 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
>
>



 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      08-18-2004
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.

"Karl" <none> wrote in message news:...
> 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
>
>
> "MS News (MS ILM)" <> wrote in message
> news:%...
> > 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
> >
> >

>
>



 
Reply With Quote
 
Karl
Guest
Posts: n/a
 
      08-18-2004
I quickly tested it before suggesting it and it seemed to be working...

Karl

"Marina" <> wrote in message
news:...
> 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.
>
> "Karl" <none> wrote in message

news:...
> > 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
> >
> >
> > "MS News (MS ILM)" <> wrote in message
> > news:%...
> > > 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
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
MS News \(MS ILM\)
Guest
Posts: n/a
 
      08-20-2004
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

"Karl" <none> wrote in message news:...
> I quickly tested it before suggesting it and it seemed to be working...
>
> Karl
>
> "Marina" <> wrote in message
> news:...
> > 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.
> >
> > "Karl" <none> wrote in message

> news:...
> > > 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
> > >
> > >
> > > "MS News (MS ILM)" <> wrote in message
> > > news:%...
> > > > 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
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Handleing at the Application Level Server Error David Lozzi ASP .Net 4 07-21-2006 01:07 AM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
c program, file size limit, how to solve? 2G bytes limit. guru.slt@gmail.com C++ 1 06-27-2005 11:05 PM
new style exception handleing Ola Natvig Python 4 02-03-2005 11:17 AM
ASP File Upload - Limit File Types? lazyadmin ASP General 1 01-07-2005 05:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57