
UDF
The UDF requires two input variables:
Code
GlobalContainer globalContainer = container.getGlobalContainer();
for (int i = 0; i < base64content.length; i++) {
try {
OutputAttachments outputAttachments = globalContainer.getOutputAttachments();
byte[] b = Base64.getDecoder().decode(base64content[i]);
//in case of non-base64 content, use byte[] b = base64content[i].getBytes();
Attachment newAttachment = outputAttachments.create(filename[i],"application/pdf", b);
//in case of different attachment type, change "application/pdf" to different content type
outputAttachments.setAttachment(newAttachment);
}
catch (Exception e) {
throw new StreamTransformationException("Error: " + e.getMessage());
}
}
Example input structure
Input example/output result
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 |