File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes could not setThe value in html:file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "could not setThe value in html:file" Watch "could not setThe value in html:file" New topic

could not setThe value in html:file

sathish kumar

Joined: Nov 02, 2006
Posts: 2
hi all,

I action form has FormFile object which has get and set method. My ActionForm extending by the ValidatorForm.

this the get and set method in my ActionForm

private FormFile theFile;

public FormFile getTheFile() {
return theFile;

public void setTheFile(FormFile theFile) {
this.theFile = theFile;

what happed was when i select the file and click sumbit button it displays follow error in the browser

java.lang.IllegalArgumentException: Cannot invoke com.form.MyForm.setTheFile - argument type mismatch

eventhough My arument passing all are corret, why displays such error

What is problem in this, guys please help me
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Did you specify enctype="multipart/form-data" in your html:form tag? If not, that's the problem.

Consultant, Sima Solutions
I agree. Here's the link:
subject: could not setThe value in html:file
It's not a secret anymore!