473,387 Members | 1,745 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,387 software developers and data experts.

Exceeding File Upload max size - trapping error

I am fully aware of the size limitations of the file upload control in
asp.net and how to change it.

But has anyone figured out how to gracefully handle the situation where an
upload atempt exceeds the maximum? By default asp.net throws up a dns error
page, this just doesn't cut it. How can I trap the error so I can inform
the user of the problem?

-Brett-
Nov 18 '05 #1
2 5421
there is no graceful way. the browser is busy uploading the file, and there
is no stop command in the http protocol, so asp.net closes the tcp/ip
socket, so there is no response (the request never finished). the browser
then picks the error message of its choice.

the only alternative is to accept the upload, throw it away then repond with
an "over limit" message. this is probably worse, because the user has to
wait for the complete upload, then be told it was useless.

-- bruce (sqlwork.com)
"Brett Robichaud" <br************@nospam.yahoo.com> wrote in message
news:#P**************@TK2MSFTNGP11.phx.gbl...
I am fully aware of the size limitations of the file upload control in
asp.net and how to change it.

But has anyone figured out how to gracefully handle the situation where an
upload atempt exceeds the maximum? By default asp.net throws up a dns error page, this just doesn't cut it. How can I trap the error so I can inform
the user of the problem?

-Brett-

Nov 18 '05 #2
there is no graceful way. the browser is busy uploading the file, and there
is no stop command in the http protocol, so asp.net closes the tcp/ip
socket, so there is no response (the request never finished). the browser
then picks the error message of its choice.

the only alternative is to accept the upload, throw it away then repond with
an "over limit" message. this is probably worse, because the user has to
wait for the complete upload, then be told it was useless.

-- bruce (sqlwork.com)
"Brett Robichaud" <br************@nospam.yahoo.com> wrote in message
news:#P**************@TK2MSFTNGP11.phx.gbl...
I am fully aware of the size limitations of the file upload control in
asp.net and how to change it.

But has anyone figured out how to gracefully handle the situation where an
upload atempt exceeds the maximum? By default asp.net throws up a dns error page, this just doesn't cut it. How can I trap the error so I can inform
the user of the problem?

-Brett-

Nov 18 '05 #3

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

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
1
by: Brett Robichaud | last post by:
I am fully aware of the size limitations of the file upload control in asp.net and how to change it. But has anyone figured out how to gracefully handle the situation where an upload atempt...
1
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp"...
6
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
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...
1
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
4
cassbiz
by: cassbiz | last post by:
Could use some help here. This script is carrying over an image just fine but the text isn't coming over. can you see why it is not working???? from the form I want to carry over two lines of...
6
Jacotheron
by: Jacotheron | last post by:
I need a PHP script that can upload music files (mp3). The script is for a home project I have started a while ago. I have a MySQL database of all the music that I have. Other computers on the...
5
by: kailashchandra | last post by:
I am trying to upload a file in php,but it gives me error msg please Help me? My Code is like below:- i have one php file named upload.php and i have another html file named upload.html and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.