Hi, You should use request.get("data") since getParameter always returns a string. Hope this helps.
Jeroen ----- Original Message ----- From: "Gerhard Hipfinger" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 12, 2002 6:15 PM Subject: upload parameter don't return FilePartFile object > Hi! > > I still have problems with the file upload functionality. When I try to > get the parameter with the uploaded file, the parameter is of String > type and not of FilePartFile! > > Here is an example code: > > <?xml version="1.0" encoding="UTF-8"?> > > <xsp:page > language="java" > xmlns:xsp="http://apache.org/xsp" > xmlns:xsp-request="http://apache.org/xsp/request/2.0" > xmlns:esql="http://apache.org/cocoon/SQL/v2"> > > <xsp:structure> > > <xsp:include>org.apache.cocoon.components.request.multipart.*</xsp:include> > <xsp:include>java.util.*</xsp:include> > </xsp:structure> > > <page xmlns:xi="http://www.w3.org/2001/XInclude"> > > <content> > > <xsp:logic> > > Object uploadData = null; > String filename = ""; > > uploadData = request.getParameter("data"); > > filename = uploadData.getClass().getName(); > > if (uploadData instanceof FilePart) { > </xsp:logic> > <paraph>Filepart confirmed</paraph> > <xsp:logic> > } > </xsp:logic> > <paraph> > <xsp:expr>uploadData.toString()</xsp:expr> > </paraph> > <paraph> > <xsp:expr>filename</xsp:expr> > </paraph> > > > </content> > > </page> > > > </xsp:page> > > I played with this xsp file to track down the problem and after > execution the value of filename = java.lang.String > > The file is uploaded in the dir specified in the web.xml but everything > else is not working as expected. > > Thanks in advance, > Gerhard > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>