B
briforge
I've seen the samples for JavaMail that illustrate how to send an
attachment using FileDataSource. However, the constructors for
FileDataSource require either a java.io.File, or a String which is
resolved as the pathname to a file.
However, I have a a stream of data which I need to convert to a file,
basically an in-memory file, so that I can pass it to the
FileDataSource constructor.
What I need to do is email a PDF as an attachment. I receive the PDF as
a response using HttpClient. So I could have a string instead of a
stream. Either way, how can I get this into FileDataSource?
attachment using FileDataSource. However, the constructors for
FileDataSource require either a java.io.File, or a String which is
resolved as the pathname to a file.
However, I have a a stream of data which I need to convert to a file,
basically an in-memory file, so that I can pass it to the
FileDataSource constructor.
What I need to do is email a PDF as an attachment. I receive the PDF as
a response using HttpClient. So I could have a string instead of a
stream. Either way, how can I get this into FileDataSource?