logo

New Response

« Return to the blog entry

You are replying to:

    • avatar
    • Jake Howlett
    • Posted on Wed 4 Jan 2012 02:16 AM

    Hi Chris,

    The JPEG is sent to an output stream and then passed to a MIME-type field like so:

    Stream stream = session.createStream();

    stream.setContents(new ByteArrayInputStream(out.toByteArray()));

    MIMEEntity Files = doc.createMIMEEntity("Files");

    Files.setContentFromBytes(stream, "image/jpeg", MIMEEntity.ENC_IDENTITY_BINARY);

    Perhaps I could skip the MIME stuff though and just use the server's disk (using the MIME trick above saves me having to use disk I/O operations).

    Jake

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: