cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen ter Voorde" <j.tervoo...@home.nl>
Subject Re: upload parameter don't return FilePartFile object
Date Fri, 14 Jun 2002 10:42:08 GMT
Hi,

You should use request.get("data") since getParameter always returns a
string.
Hope this helps.

Jeroen

----- Original Message -----
From: "Gerhard Hipfinger" <gerhard.hipfinger@openforce.at>
To: <cocoon-users@xml.apache.org>
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:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message