| Author |
how to send files stored as blob in mysql as attachment
|
Joshua Cloch
Ranch Hand
Joined: Apr 27, 2006
Posts: 95
|
|
Hey guys,thanks for your attention. Here is my question: Now,in my website I can upload some files into MYSQL DB,and I want to select some of these files as attachment to be sent to customer. I know it is very easy if the file is stored as a file in a particular directory,what i need is to get the path of the file and then use a javamail function "attachFile(path)",how can i do it when the file is stored as blob?Is there any javamail function which can be used to manipulate this process?
|
truehh@hotmail.com
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
Moving to Other Java APIs where the Javamail gurus hang out.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
Read the BLOB into a byte array in your program. Then use a ByteArrayDataSource to attach it to the message.
|
 |
Joshua Cloch
Ranch Hand
Joined: Apr 27, 2006
Posts: 95
|
|
|
Thanks,I will test it on next monday.
|
 |
Joshua Cloch
Ranch Hand
Joined: Apr 27, 2006
Posts: 95
|
|
|
It works pretty good.Thanks again!
|
 |
 |
|
|
subject: how to send files stored as blob in mysql as attachment
|
|
|