cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Write binary data (file content) to the output stream
Date Wed, 27 Jun 2007 11:09:50 GMT
Hi all, 
i wanna open a generate a binary file on the fly and write send it directly to the user.
I didn't found an easy way in cocoon to achieve this.
Therefore i have tried using an action, which gets the output stream and writes the byte array
into the stream.

response.setHeader("Content-Disposition", "attachment; filename=" + filename);

OutputStream out = response.getOutputStream();




the sitemap.xmap looks like this:
<map:match pattern="**">

<map:act type="binary-download"/>


It does function, but when i open in an editor, then i see the file content followed by an
cocoon error message saying that a ResourceNotFoundException has been occured.
1. Any idea why i get the message?
2. Is there a better way sending binary data without writing it to the filesystem?
Thanks in advance.

View raw message