i've not used dynaforms with fileupload so if that is the 
problem I couldn't say. you could try it with a normal 
formBean.

However as the problem is trying to set  a formfile using a 
string it looks like the problem could be in your jsp.

have you set the enctype like below,
<html:form action="/blah" enctype="multipart/form-data">

and the form property using html:file rather than html:text
<html:file property="pb_file"/>

goodluck,

c


On Friday 14 November 2003 13:38, sairam manda wrote:
> Hello Sir,
>
> I am new to sturts . I want to upload a file . I am using
> dynaform .
>
> these are snippets
> in the dynaform I used
>
>
>      <form-property name="pb_file"
> type="org.apache.struts.upload.FormFile"/>
>
>
> and in my action class
> I used the following code
>
>
>      FormFile file = (FormFile) form.get("pb_file");
>
> I get the following error
>
>
> org.apache.commons.beanutils.ConversionException: Cannot
> assign value of type 'java.lang.String' to property
> 'pb_file' of type 'org.apache.struts.upload.FormFile'
>       org.apache.struts.action.DynaActionForm.set(DynaActionFo
>rm.java:423)
> org.apache.commons.beanutils.PropertyUtils.setSimplePrope
>rty(PropertyUtils.java:1769)
> org.apache.commons.beanutils.PropertyUtils.setNestedPrope
>rty(PropertyUtils.java:1684)
> org.apache.commons.beanutils.PropertyUtils.setProperty(Pr
>opertyUtils.java:1713)
> org.apache.commons.beanutils.BeanUtils.setProperty(BeanUt
>ils.java:1019)
> org.apache.commons.beanutils.BeanUtils.populate(BeanUtils
>.java:808)
> org.apache.struts.util.RequestUtils.populate(RequestUtils
>.java:1252)
> org.apache.struts.action.RequestProcessor.processPopulate
>(RequestProcessor.java:821)
> org.apache.struts.action.RequestProcessor.process(Request
>Processor.java:254)
> org.apache.struts.action.ActionServlet.process(ActionServ
>let.java:1482)
> org.apache.struts.action.ActionServlet.doPost(ActionServl
>et.java:525)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:7
>63)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:8
>56)
>
>
> can somebody make me waware of the problem.
> regards
> sairam
>
> _________________________________________________________
>________ Enjoy shopping online? Get this e credit card.
> http://server1.msn.co.in/features/amex/ It cuts cost &
> adds value!
>
>
> ---------------------------------------------------------
>------------ To unsubscribe, e-mail:
> [EMAIL PROTECTED] For additional
> commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to