cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Hoechstaedter <>
Subject MultiPart upload action
Date Fri, 17 Oct 2008 14:39:46 GMT
Hi, everybody,

I want to upload a file into my database. I want to upload it by my own 
action. I followed several examples for file uploads in cocoon for 
example: and followed 
this thread .

My code in the act method of my action look as follows:

Request  request = (Request)ObjectModelHelper.getRequest(objectModel);
Part filePart = (Part) request.get("picture");

I get a class cast exception in the third line: 
"java.lang.ClassCastException: java.lang.String". 
request.get("picture"); returns a String. How can I get a Part object? 
The filename is printed out correctly in line 2.

This is my html:

<form method="get" action="someaction">

<form enctype="multipart/form-data" method="post" action="/webapp-1.0/switch/severalparameters">
<input type="file" name="picture"><input class="button" value="Upload" name="submit"


I would be happy if anyone can help.


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

View raw message