dcsimg
How to get the attachment in mail from client on the server?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhou_tao
Posted On:   Thursday, June 14, 2001 01:54 AM

I want to allow client to add attach with their mail from the the html page.But when test using following code,the *.jsp get the file from the server not from the client machine! here is the code I write: MimeBodyPart mbp2=new MimeBodyPart(); FileDataSource fds=new FileDataSource("c:\SET.TXT"); mbp2.setDataHandler(new DataHandler(fds)); mbp2.setFileName(fds.getName()); Multipart mp=new MimeMultipart(); mp.addBodyPart(mbp2); newMessage.setContent(mp); Also,I want to use the html tag--input type=file. but I don't know how to deal with it on the server side. So,there are two things: 1   More>>


I want to allow client to add attach with their mail from the the html page.But when test using following code,the *.jsp get the file from the server not from the client machine!
here is the code I write:


MimeBodyPart mbp2=new MimeBodyPart();

FileDataSource fds=new FileDataSource("c:\SET.TXT");

mbp2.setDataHandler(new DataHandler(fds));

mbp2.setFileName(fds.getName());

Multipart mp=new MimeMultipart();

mp.addBodyPart(mbp2);

newMessage.setContent(mp);





Also,I want to use the html tag--input type=file. but I don't know how to deal with it on the server side.

So,there are two things:

1.how to deal with file tag?

2.how to write code on server to deal with the file specified by client?


Please give me some advice,thanks.

   <<Less

Re: How to get the attachment in mail from client on the server?

Posted By:   John_Zukowski  
Posted On:   Thursday, June 14, 2001 11:12 AM

Uploading files from the client is already covered in the FAQ
About | Sitemap | Contact