(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);
var file_name = sender.attachment_name;
var mime_type = sender.attachment_type;
var attach_id = sender.attachment_id;
//-----------------------
//-----------------------
scratchpad.file_name = encodeURIComponent(file_name);
scratchpad.reference = stage.external_reference;
// /attachment?file_name=${scratchpad.file_name}&reference=${scratchpad.reference}
//-----------------------
//-----------------------
// Compose the scratchpad headers and payload
"Content-Type": mime_type
//-----------------------
//-----------------------
// This is the string that triggers attachment streaming outbound
payload = 'sys_attachment:' + attach_id;
})(request, stage, transaction, message, bond, scratchpad);