Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Upload file and mail it

 
david wittenberg
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I wish to upload a file using struts (this is succesfull, in my action class i have a FormFile) now i want to email this file. How do i get from a FormFile to a File. Is there a way to get the absolute path from the FormFile, or is there another way so i can mail the uploaded file?

Thanks in advance

David
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting the file in the server is quite easy and using multipart mail API you can construct a multipart message body and send using the standard java mail api.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic