473,396 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

File upload limit handleing

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
Nov 18 '05 #1
4 1439
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)" <sq***********@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #2
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:Ob**************@TK2MSFTNGP12.phx.gbl...
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)" <sq***********@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
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


Nov 18 '05 #3
I quickly tested it before suggesting it and it seemed to be working...

Karl

"Marina" <so*****@nospam.com> wrote in message
news:OJ*************@TK2MSFTNGP12.phx.gbl...
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:Ob**************@TK2MSFTNGP12.phx.gbl...
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)" <sq***********@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
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



Nov 18 '05 #4
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:es**************@tk2msftngp13.phx.gbl...
I quickly tested it before suggesting it and it seemed to be working...

Karl

"Marina" <so*****@nospam.com> wrote in message
news:OJ*************@TK2MSFTNGP12.phx.gbl...
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:Ob**************@TK2MSFTNGP12.phx.gbl...
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)" <sq***********@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
> 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
>
>



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Thomas Mlynarczyk | last post by:
Hello, I want to upload files via an HTML form and store them somewhere on my webspace. So far so good. I am just a bit concerned about security issues and traffic. My provider has set a file...
5
by: Jefferis NoSpamme | last post by:
Hi all, I'm trying to limit the file size of an image submission and I keep running into various problems. I've got most of it working, but I'm stumped and I have a basic question as to WHY this...
0
by: leenadiwan | last post by:
I want to throw an error immediately if user is trying to upload a file of size greater than the specified limit. We are checking content-Length for this. But, if Im not mistaken, for large files...
6
by: | last post by:
Hi, I use upload control, how to enable upload *.pdf file and enlarge file size? Please help.
6
by: howa | last post by:
Suppose the file is stored in "upload_tmp_dir ", so why I need to increase the memory limit? If I want to upload 100 MB, how large should I set? Thanks.
2
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but...
16
by: Lawrence Krubner | last post by:
To guard against our users possibly uploading huge files, I've got this in my php.ini file: ; Maximum size of POST data that PHP will accept. post_max_size = 10M On a server running Ubuntu...
8
omerbutt
by: omerbutt | last post by:
hi there i have a form with multiple input (type/text ) fields and three inputs(type/file) fields i have to submit the form via ajax because i have multiple forms on this page ,you can say it is a...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.