This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to convert File object to Formfile object

 
venkatesh warlu
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic