You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by karthik <ak...@infosys.com> on 2014/04/10 14:40:25 UTC

Edit the attachement content using camel mail

Hi Team,

Is there any way possible that we can edit the attachment content on the way
using camel api.
I am facing an issue where additional junk characters are getting introduced
in the attachement due to which i am getting an getting an exception like
this.
com.sun.mail.util.DecodingException: BASE64Decoder: Error in encoded stream:
needed at least 2 valid base64 characters, but only got 0 before padding.
I am using IMAP protocol and tried using the
props.setProperty("mail.imaps.partialfetch", "false") but it did not work.
I am able to get the data using the following statement and want to ignore
some special characters that are getting inserted additionally.

           // get the content and convert it to byte[]
          byte[] data =
exchange.getContext().getTypeConverter().convertTo(byte[].class,
dh.getInputStream());

Any help or pointers would be of great help..

Thanks in advance.

Regards,
Karthik.



--
View this message in context: http://camel.465427.n5.nabble.com/Edit-the-attachement-content-using-camel-mail-tp5750048.html
Sent from the Camel - Users mailing list archive at Nabble.com.