Abrupt user cancelling

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Abrupt user cancelling

Guest-28
I'm trying to trace how the program flows.  What function gets executed (or does any), when the user decides to suddenly close the browser during the upload?

I've written similar stuff before, and find that the aspnet process continues to upload the file (if it's large like 50mb), even after user closes the browser (say the file got uploaded 50%).
Is there something that catches that case and stops the process in neatupload?

I would guess it's similar to the cancel function?
but other than all those javascript functions cancel involves...I can't really map it to any of the server side functions...

please someone enlighten me.
Thanx
Reply | Threaded
Open this post in threaded view
|

Re: Abrupt user cancelling

Dean Brettle
Administrator
> I'm trying to trace how the program flows.  What function gets executed (or does any), when the user decides to suddenly close the browser during the upload?

AFAIK, when a user closes a browser, it disconnects from all servers and any uploads are immediately stopped.  On the server side, either an exception is thrown or no bytes are read when HttpWorkerRequest.ReadEntityBody() is called.  In either case, NeatUpload stops processing the upload and marks it as cancelled.

> I've written similar stuff before, and find that the aspnet process continues to upload the file (if it's large like 50mb), even after user closes the browser (say the file got uploaded 50%).

You might have been running into the problem that by the time the code on any aspx page gets executed, ASP.NET has already read the entire request from the client.  NeatUpload avoids that pitfall by using an HttpModule to intercept the request when ASP.NET first receives it.

> Is there something that catches that case and stops the process in neatupload?

NeatUpload handles exceptions and out-of-data results from ReadEntityBody() in FilteringWorkerRequest.cs.

Hope that helps,

--Dean