• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Struts FormFile to java.io.File

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

In my application, people have to select a file (a struts FormFile) in a form. After the file was submitted, it should be send as an attachment in a mail. I'm using the Javamail package to send mails.

The problem I'm facing is that I can't cast the FormFile to a java.io.File which is needed by the JavaMail package. Do you have any idea how to do that?

Here's the code I use to attach a file to a mail:

[ October 09, 2006: Message edited by: Tim Storms ]
 
Tim Storms
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been to fast. Here's the solution:

reply
    Bookmark Topic Watch Topic
  • New Topic