This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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


Win a copy of Building Microservices this week in the Design forum!
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
 
It's not a secret anymore!