This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
On the server side : You need two jar files -- mail.jar & activation.jar
U will have to use MimeMultiPart ---- javax.mail.internet.MimeMultipart which takes javax.activation.DataSource in the constructor. You will have to provide the implementation of this datasource.
1. Get the count on MimeMultiPart which tells the total files uploaded. 2. Call getBodyPart(index i) . 3. BodyPart has the api's like getFileName(), getInputStream() which is the content of the part for ex. image file. 4. Now you have to create a file on the server and transfer this inputstream of the bodypart into the newly created file.
I wouldn't use the mail classes to upload the file... I'd use a separate set designed especially for uploads. Two that come to mind are the jakarta commons upload classes, and a set from O'Reily (think they're by Jason Hunter, the same person who wrote their servlet book).
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com