cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: Write binary data to output stream from flow
Date Thu, 17 Feb 2005 16:19:02 GMT
Bart Molenkamp wrote:
> Hi,
> 
> Is it possible to write binary data to the HTTP response directly from
> the flow? I have an InputStream available in my flow, and I want to
> serve data from that stream directly to the HTTP response. E.g.
> 
> cocoon.sendBinaryData(inputStream, "application/octet-stream");
> 
> Or something similar.
> 
> I solved it now by creating a SourceFactory and Source implementation,
> so that I can use a plain reader, but this feels a bit like overkill.
> The SourceFactory has to lookup the data from the database (that is
> where the data is for the input stream), and the URL contains the
> primary key to get the data from the database.

To my knowledge there isn't a way to do this directly. But you could 
place the inputstream into a request attribute or some such, and pick 
that up from your source, rather than reading the database again.

Am I understanding your question right?

Regards, Upayavira

Mime
View raw message