tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "du Plessis, Corneil C" <>
Subject RE: Writing large file in HttpResponse
Date Thu, 25 Nov 2004 16:45:14 GMT
You can use a bufferedwriter/stream around the response stream that will
ensure regular flushes.
I you know the exact size of the output you can use setContentLength on the

-----Original Message-----
From: Rui Alberto L." Gonçalves []
Sent: 25 November 2004 18:27
Subject: Writing large file in HttpResponse

Hi all,
sorry if this question is off topic,
but I think that someone with good knowledge of the HTTP
protocol might be able to help me.

I'm using Apache cocoon under Tomcat 5.0.25.
Some time ago I wrote a Reader that reads from an InputStream 
and writes in the HTTP Response to the client. The response is
a potentially very large text file. (text/csv)

I'm reading and writing at the same time, but it appears to me
that the response is only effectively written to the client when the
OutputStream is closed!

When writing a small file (~3Mb) the client receives the file correctly,
but when the response size grows to 10 or 20 Mb, after a long 
delay, the popup (save as ..) appears, but the saved file has 0bytes.

Does anyone have any idea of what I may be missing, or at least point me
in the right direction?

Thanks for any help.



To unsubscribe, e-mail:
For additional commands, e-mail:


For information about the Standard Bank group visit our web site <>
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relating to the official business of Standard
Bank Group Limited  is proprietary to the group. 
It is confidential, legally privileged and protected by law. 
Standard Bank does not own and endorse any other content. Views and opinions are those of
the sender unless clearly stated as being that of the group. 
The person addressed in the e-mail is the sole authorised recipient. Please notify the sender
immediately if it has unintentionally reached you and do not read, 
disclose or use the content in any way.
Standard Bank can not assure that the integrity of this communication has been maintained
nor that it is free of errors, virus, interception or interference.

Licensed divisions of the Standard Bank Group are authorised financial services providers
in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS). 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message