Special characters in attachment file names
(function processStageToRequest(request, stage, transaction, message, bond, scratchpad) {
// This information would normally come from the AttachmentSender
var sender = new x_snd_eb.AttachmentSender(transaction, bond);
sender.next();
var file_name = sender.attachment_name;
var mime_type = sender.attachment_type;
var attach_id = sender.attachment_id;
var reference = bond.getValue('external_reference');
//-----------------------
// Path construction
//-----------------------
scratchpad.file_name = encodeURIComponent(file_name);
scratchpad.reference = encodeURIComponent(reference);
// ?file_name=${scratchpad.file_name}&reference=${scratchpad.reference}
//-----------------------
// Headers construction
//-----------------------
// Compose the scratchpad headers and payload
scratchpad.headers = {
"Content-Type": mime_type
};
//-----------------------
// Payload construction
//-----------------------
// This is the string that triggers attachment streaming outbound
payload = 'sys_attachment:' + attach_id;
})(request, stage, transaction, message, bond, scratchpad);Last updated
Was this helpful?
