Frontdan gelen base64 file contenti mail de attachment kimi gondermek
String cnt = attachmentDto.getContent();
int index = cnt.indexOf(",") + 1;
// cnt = cnt.replaceFirst("^data:image/[^;]*;base64,?", "");
cnt = cnt.substring(index);
byte[] bytes = javax.xml.bind.DatatypeConverter.parseBase64Binary(cnt);
mimeMessageHelper.addAttachment(
attachmentDto.getName(),
new ByteArrayResource(bytes)
);
Comments
Post a Comment