tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "du Plessis, Corneil C" <Corneil.duPles...@standardbank.co.za>
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
response.

-----Original Message-----
From: Rui Alberto L." Gonçalves [mailto:rui-l-goncalves@ptinovacao.pt]
Sent: 25 November 2004 18:27
To: tomcat-user@jakarta.apache.org
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 2.1.5.1 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.

Rui

-- 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

__________________________________________________________________________________________________________________________________

For information about the Standard Bank group visit our web site <www.standardbank.co.za>
__________________________________________________________________________________________________________________________________
	
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). 
___________________________________________________________________________________________________________________________________

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