Hello Jan,
Here is a sample policy for multi-part response. But it's for text. I'm not sure if you can load binary data into a context variable ${attachment}, if yes, then you can use this policy.
<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<L7p:SetVariable>
<L7p:AssertionComment assertionComment="included">
<L7p:Properties mapValue="included">
<L7p:entry>
<L7p:key stringValue="LEFT.COMMENT"/>
<L7p:value stringValue="v2 - 1"/>
</L7p:entry>
</L7p:Properties>
</L7p:AssertionComment>
<L7p:Base64Expression stringValue="VGhpcyBpcyBhbiBhdHRhY2htZW50Lg=="/>
<L7p:VariableToSet stringValue="attachment"/>
</L7p:SetVariable>
<L7p:SetVariable>
<L7p:AssertionComment assertionComment="included">
<L7p:Properties mapValue="included">
<L7p:entry>
<L7p:key stringValue="LEFT.COMMENT"/>
<L7p:value stringValue="v2 - 2"/>
</L7p:entry>
</L7p:Properties>
</L7p:AssertionComment>
<L7p:Base64Expression stringValue="LS1YWFhYYm91bmRhcnkNCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbg0KDQp0aGlzIGlzIHRoZSBib2R5IHRleHQNCg0KLS1YWFhYYm91bmRhcnkNCkNvbnRlbnQtRGVzY3JpcHRpb246IEZpbGUgVHJhbnNmZXINCkNvbnRlbnQtRGlzcG9zaXRpb246IGF0dGFjaG1lbnQ7ZmlsZW5hbWU9InRlc3QudHh0Ig0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0NCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJpbmFyeQ0KRXhwaXJlczogMA0KQ2FjaGUtQ29udHJvbDogbXVzdC1yZXZhbGlkYXRlLCBwb3N0LWNoZWNrPTAsIHByZS1jaGVjaz0wDQpQcmFnbWE6IHB1YmxpYw0KDQoke2F0dGFjaG1lbnR9DQoNCi0tWFhYWGJvdW5kYXJ5LS0="/>
<L7p:VariableToSet stringValue="resp"/>
</L7p:SetVariable>
<L7p:HardcodedResponse>
<L7p:AssertionComment assertionComment="included">
<L7p:Properties mapValue="included">
<L7p:entry>
<L7p:key stringValue="LEFT.COMMENT"/>
<L7p:value stringValue="v2 -3"/>
</L7p:entry>
</L7p:Properties>
</L7p:AssertionComment>
<L7p:Base64ResponseBody stringValue="JHtyZXNwfQ=="/>
<L7p:ResponseContentType stringValue="multipart/mixed;boundary=XXXXboundary"/>
</L7p:HardcodedResponse>
</wsp:All>
</wsp:Policy>