File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to convert File object to Formfile object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to convert File object to Formfile object" Watch "How to convert File object to Formfile object" New topic
Author

How to convert File object to Formfile object

venkatesh warlu
Ranch Hand

Joined: Mar 11, 2008
Posts: 33
Hi all,

I am having a file object. I need to convert it into FormFile object. It shows classcastexception when try to type cast it. Please help.

File reqFile = new File("file.txt");
myForm.setReqFile(reqFile);

The setReqFile is a private Formfile variable in my form like "private FormFile reqFile;"

Thanks in advance!!

Regards
Venkat
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to convert File object to Formfile object