473,221 Members | 2,017 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,221 software developers and data experts.

User closing the browser while uploading

I've written a file uploading part of my application using the IHttpModule.
So now, I don't have the memory problem of uploading something big.

Problem:
I can't find which function I have to override, so that I can catch the
event when while user's uploading a file, then suddenly closes the browser.
In that case, couple things happens:
1) ASPNET will start eating up the uploading file on memory instead of on
disk (so picture a hose....water's going into bucket (disk)...then suddenly
you take the bucket away...water gets spilled all over the place (memory))
For some reason, the upload doesn't stop, when the user closes the browser.
2) When the user closes the browser, in my code where I divert the "water"
into the "bucket", the finally section doesn't run at all. Either the
application completely jumped the gun (highly unlikely), or the application
jumped into another higher level method (explaning why the memory hogging on
memory) while childed in my function, so it doesn't "reach" my finally.

Any idea?
Nov 19 '05 #1
3 2597
oops, posted too fast, but I was right on the second case...finally does get
run...at the end...after aspnet finish playing around with eating up memory.

So...is there a way to stop it from continuously working even after the user
closes the browser?

for example if the user uploads a 5 meg file...for some odd reason after I
close the browser on it....it will continue to run and eat up say...300 megs
on aspnet....then when it's done, my finally runs.

but I'm sure after the browser's closed..it's not running inside my
function...because else my file will continue to increase in size...but it
doesn't...
Nov 19 '05 #2
to do this right you should write an isapi filter. a little how asp.net
work.

client browser request ------tcp/ip --> iis --named pipe-->asp.net
worker process
client browser response <-- tcp/ip -- iis <-- named pipe --asp.net
worker process
as iis recieves the upload and it sends the inputstream to the asp.net
worker process (thru a named pipe). Asp.net them stores the input stream in
memory. any refence to the input stream generally create a copy string (used
for parsing).

you want an isapi filter which can redirect the file upload data to a
tempfile and pass the filename(s) onto asp.net in the payload or in a custom
header.

note: if you close the browser it sends a fin to iis. this is perfectly
valid way to mark the end of a post. this was always the case in http 1.0 -
its how a the browser signed the end of the requst -- by closing the pipe.
the webserver just read the input stream until end of file was reached. iis
won't discover the browser is not listening anymore until it tries to send a
response.

-- bruce (sqlwork.com)

"Jason Chu" <Ja******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
oops, posted too fast, but I was right on the second case...finally does
get
run...at the end...after aspnet finish playing around with eating up
memory.

So...is there a way to stop it from continuously working even after the
user
closes the browser?

for example if the user uploads a 5 meg file...for some odd reason after I
close the browser on it....it will continue to run and eat up say...300
megs
on aspnet....then when it's done, my finally runs.

but I'm sure after the browser's closed..it's not running inside my
function...because else my file will continue to increase in size...but it
doesn't...

Nov 19 '05 #3
Can the asp.net httpmodule or the httphandler not handling the browser
closing event?

I really don't want to leave the .net zone and going into something where I
have to write C++ codes. Isn't any of the asp.net functions executed when
the user closes the browser?
"Bruce Barker" wrote:
to do this right you should write an isapi filter. a little how asp.net
work.

client browser request ------tcp/ip --> iis --named pipe-->asp.net
worker process
client browser response <-- tcp/ip -- iis <-- named pipe --asp.net
worker process
as iis recieves the upload and it sends the inputstream to the asp.net
worker process (thru a named pipe). Asp.net them stores the input stream in
memory. any refence to the input stream generally create a copy string (used
for parsing).

you want an isapi filter which can redirect the file upload data to a
tempfile and pass the filename(s) onto asp.net in the payload or in a custom
header.

note: if you close the browser it sends a fin to iis. this is perfectly
valid way to mark the end of a post. this was always the case in http 1.0 -
its how a the browser signed the end of the requst -- by closing the pipe.
the webserver just read the input stream until end of file was reached. iis
won't discover the browser is not listening anymore until it tries to send a
response.

-- bruce (sqlwork.com)

"Jason Chu" <Ja******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
oops, posted too fast, but I was right on the second case...finally does
get
run...at the end...after aspnet finish playing around with eating up
memory.

So...is there a way to stop it from continuously working even after the
user
closes the browser?

for example if the user uploads a 5 meg file...for some odd reason after I
close the browser on it....it will continue to run and eat up say...300
megs
on aspnet....then when it's done, my finally runs.

but I'm sure after the browser's closed..it's not running inside my
function...because else my file will continue to increase in size...but it
doesn't...


Nov 19 '05 #4

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

Similar topics

60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
7
by: Joe | last post by:
I have an upload file operation in the web application. UploadForm.asp is the form, and UploadAction.asp is the form processing. //UploadForm.asp <FORM NAME="InputForm"...
2
by: Asit | last post by:
How can i know when user clicks X button of the browser ? I have to write some code when user clicks X button of browser. What is the event for capturing this event ? Help needed ASAP. Asit
1
by: Chirag Malvi | last post by:
hello all, I am developing the web application using ASP.net and VS.2003 IDE. here is the situation which i want to implement. 1) User is browsing some webform. I want to trap this event....
1
by: feng | last post by:
Hi, When user closes a browser window by clicking on the "X" button, I want the server to be noticed (either through postback or calling other ASP pages, etc.) and perform some task...
7
by: wrytat | last post by:
Is there a way to check whether the user has confirmed all his items in a shopping cart when he is closing the browser? Then if he hasn't confirm the items, the system can prompt him to confirm the...
7
by: tarun.kataria | last post by:
Hi All, Is there any way to detect that the user is trying to Xout the browser window instead of hitting a button. Because in my application I want to make it sure that they dont do it either...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
20
by: luqman | last post by:
If user login with the login control in ASP.Net 2005 and then just close the browser and then open the browser again, the login status shows, User still Login? Any idea, how to Logout the User...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.