dcsimg
How to send an image to the client using JavaMailAPI
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Saturday, June 1, 2002 02:58 AM

Hi

Can U please suggest me as to how to send gif image to the html page without sending it as an attachment file or in the image tag.
What i mean is I dont have or I dont want to store image in a file instead Iam having an InputStream from some other class which has the image.
Now can I pass the StreamObject to the javamailapi's method and write the image to the response as image/gif


Thanx in advance


Srihari

Re: How to send an image to the client using JavaMailAPI

Posted By:   Anonymous  
Posted On:   Monday, June 3, 2002 12:12 AM

Yeah I got it.ByteArrayDataSource is the class in which we can pass InputStream & contenttype to the constructor.
And it was possible to send image from memory.

Message msg = new MimeMessage(session);
msg.setDataHandler(new DataHandler(new ByteArrayDataSource(InputStream input,String "image/gif");
Transport.send(msg);


Thanx

Srihari
About | Sitemap | Contact