Wow, surprised you never got an error!?! I am using struts 1.1b3 and recieve an IllegalArgumentException (argument type mismatch) from BeanUtils.populate when the user does not specify a file to upload (leaves form entry blank).
I verified the following:
- I have my form's enctype set to "multipart/form-data"
- I have my form bean's property for the file to upload declared as type FormFile
- Even though my struts-config says that my form bean should validate (validate="true"), the validate() method is never called. The exception comes before the validate() method gets a change to be invoked. This leads me to assume that it is the binding of the html form values to the form bean that is the culprit...

I have also verified this behavior under struts 1.02. If you do not receive this error, then can you tell me what version of struts you are running?

Thanks!!!

J�rg Maurer wrote:

Never get an error- sorry! Send mor info?

-----Original Message-----
From: Joey Ebright [mailto:[EMAIL PROTECTED]]
Sent: Montag, 10. Februar 2003 02:34
To: Struts Users Mailing List
Subject: Re: Problem with empty file upload field


What happens if the user does not specify a file to upload and you submit the form? Do you get an error? How do you handle this?

J�rg Maurer wrote:


Just for info - I use struts 1.3b nb and built upload func into my
current app - no problem. Remark what i corrected from wrong in first
step :

1. <html:form action="...enctype="multipart/form-data"> <- !!!!!!

2. use as property a property of type FileForm from org.apache.struts -
it was a crazy idea to me to put a Form into a Form first ;-)

3. erhm, and don�t open input stream on blank filename

Ciao J�rg


-----Original Message-----
From: Joey Ebright [mailto:[EMAIL PROTECTED]]
Sent: Sonntag, 09. Februar 2003 22:20
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Problem with empty file upload field


I too have the same problem - whenever the user does not supply a file to upload I get an exception. I have tried the 1.1-b3 release of

struts

and the 1.6 release of the commons and recieve the same error from BeanUtils.populate - IllegalArgumentException...

Have you made any progress on this front?

-Joey



---------------------------------------------------------------------
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]








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