We never found a way to do this since both Apache and JServe enforce valid 
HTTP, which requires the full request to be received before you can send 
any sort of HTTP response.

The only way we found around this was to have a second 'channel' open to 
the client and make the client cancel the upload ... imagine a second 
frame/window that talks to the server to check progress and then uses 
Javascript to stop the uploading-frame if some precondition fails.

It's kind of a pain in the rear to get right, but you can see it in our 
little pop-up upload progress bar:  http://www.driveway.com

Incidentally, our site transfers over a Terabyte of data per day through 
JServ ... the only stability problems we've had were from the interaction 
with buggy commercial products (WebLogic, etc.).  Good job, guys.


--On Thursday, September 28, 2000 10:57 AM -0400 west suhanic 
<[EMAIL PROTECTED]> wrote:

> Hello All:
>
> I am using RedHat 6.1 on an Intel Box with Apache 1.3 and Jserv 1.1.
>
> I am doing a file upload. However I wish to stop the upload if the user
> exceeds the maximum file upload limit. It is very straight forwardto
> detect
> when the upload length exceeds the maximum allowable. When I detect
> this situation I throw an exception and do a close on the
> ServletInputStream.
> However the browser-( both IE and Netscape do this)-still sends data. If
> the
> file is 245 Megs in size, it will have to send all 245 Megs before the
> client stops. It, the browser, will then stop and then it will receive
> the message that
> the upload limit is exceeded.
>
> Is there any way to:
>
> i) Stop the browser from sending the data
>
> OR
>
> ii) Closing get at the socket that the Browser is writing to. I assume
> this socket is opened
> up in Apache. Is there any module that links JServ to the underlying
> Apache socket software
> so that a close on the ServletInputStream also causes the socket in
> Apache to be closed. I have
> seen this question asked before but I never saw a definitive answer.
> Does Tomcat address
> any of these issues.
>
> Thank you in advance,
>
> west suhanic
>
>
>
>
> --
> ----------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]






--
----------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to