cocoon-users mailing list archives

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

I have some problems using FileUploads and the class class
org.apache.cocoon.components.request.multipart.FilePartArray.

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"/>
<map:serialize/>


upload.xsp:

...
<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");

java.io.BufferedReader in = new java.io.BufferedReader(new
java.io.InputStreamReader(filePartArray.getInputStream()));
String buffer;
while ((buffer = in.readLine()) != null) {
System.out.println(buffer);
}

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:transform>
<map:serialize type="fo2pdf"/>
</map:match>

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)?

Thanks
Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message