camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ychawla <premiergenerat...@yahoo.com>
Subject Re: SMTP: sending file binary as attachment corrupted
Date Wed, 07 Mar 2012 15:04:27 GMT
Hello,
I remember I had some issues attaching files so I added a processor that
read them directly from the file system.  For example:

	public void addEmailAttachment(Exchange ex)
	{
		String fileNameWritten =
(String)ex.getIn().getHeader("CamelFileNameProduced");
		
		ex.getIn().addAttachment("filename.zip", new DataHandler(new
FileDataSource(fileNameWritten)));
	}

The Camel Header: CamelFileNameProduced is the actual path to the file on
the file system.

Thanks,
Yogesh

--
View this message in context: http://camel.465427.n5.nabble.com/SMTP-sending-file-binary-as-attachment-corrupted-tp5543701p5544370.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message