[EMAIL PROTECTED] wrote:
> generate a binary file on the fly and send it directly to the user
What you need is a reader, not an action.
If the data is already in a file, you can use the file reader:
<!-- /downloads/myfile.zip -->
<match pattern="downloads/*">
<read src="downloads/{1}"/>
</match>
If the data is in a database, you can use the database reader:
<reader name="db" src="org.apache.cocoon.reading.DatabaseReader">
<use-connection>my_database</use-connection>
</reader>
<!-- /binary?id=1234 -->
<match pattern="binary">
<read type="db" src="{request-param:id}">
<parameter name="table" value="binary_objects"/>
<parameter name="key" value="binobj_id"/>
<parameter name="image" value="binobj_blob"/>
</read>
</match>
If your use case is more complex, then you need to use Javascript (by
writing a piece of Flowscript) or Java (by writing a custom reader or
some Javaflow, not an action.)
Tobia
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]