cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Rudolph" <>
Subject FilePartArray as input for other pipeline
Date Wed, 05 Jan 2005 09:05:47 GMT

I have some problems using FileUploads and the class class

In the fist step I'm uploading a file within the upload.xsp. It is the
standard File Upoad example within the cocoon documentation.
I don't want to create a physical file, so I used the FilePartArray. I have
checked the FilePartArray, it contains the uploaded xml file.

<map:match pattern="sample-xsp">
<map:generate src="invoice/xsp/upload.xsp" type="serverpages"/>


<form method="post" enctype="multipart/form-data" action="sample-xsp">
File:  <input type="file" name="uploaded_file" size="50"/>
<input type="submit" value="upload File"/>
<!-- check FilePartArray > OK -->

FilePartArray filePartArray =  (FilePartArray)request.get("uploaded_file"); in = new;
String buffer;
while ((buffer = in.readLine()) != null) {

InputStream is = filePartArray.getInputStream();

In the second step I want the uploaded xml (FilePartArray) file to be the
input for another generator. Here's the sitmap code:

<map:match pattern="sample-xsp3">
<map:generate type="stream"/>
<map:transform src="invoice/stylesheets/xml-fo-stylesheet.xsl">
<map:parameter name="use-request-parameters" value="true"/>
<map:serialize type="fo2pdf"/>

I have tried to use the stream generator but I only got the null pointer
exception. How can I pass the FilePartArray as
an input to another generator (sample-xsp -> sample-xsp3)?


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

View raw message