cancel
Showing results for 
Search instead for 
Did you mean: 

Gather Zip aggregator - How do I control the name of the ZIP file

peter_munt4
Participant
0 Kudos
175

Hi 

I hope you can assist me.   

I have a HTTP sender request to an iFlow that for an Invoice number will go and get all the attachments. Some of my invoices have multiple PDF attachments. This works except I cannot control the name of the output.

I want the name of the output to be ATTACHMENTS.ZIP but it always has the name of the first attachment.

So in my example I have an invoice with 2 attachments;
Service Charges.pdf
Equipment Repairs.pdf

But when I run my iflow I am returned an object with the name Equipment Repairs.pdf. But it is in fact the ZIP file with 2 attachments inside of it.

How do I control the name of the ZIP file to be AINVOICETTACHMENTS.ZIP ?

I have tried directly setting the CamelFileName but this only controls the name of the attachments themselves.    That expression is ( attachments/${property.Query-LogicalDocument}.pdf  ) I have also tried putting it into the GatherAttachments but same results.    Note the property.Query-LogicalDocument will have a unique ID in it per attachment that is obtained from the Invoice 

Gather.png

 

At the moment the Gather ZIP File Name comes from its content modifier above.  I certainly understand it is necessary to have that Gather ZIP File Name as unique particularly when I query an Invoice with multiple attachments -otherwise the iFlow will fail with an "internal server error occured: duplicate entry".   So even if I put the same expression into the Gather File Name I get the same result.

AggregateStrategy.png

So I want to control the actual name of the ZIP file itself.  But how ?

View Entire Topic
peter_munt4
Participant
0 Kudos

aren't you lucky.  I've answered my own question. I hope someone else finds this helpful.

in a content modifier can I simply set Content-Disposition to a constant of 'attachment; filename="AINVOICETTACHMENTS.ZIP"' So the constant string contains the word attachment followed by the filename.

Boom !

peter_munt4_0-1723093688868.png

And here is the ZIP file returned 

peter_munt4_1-1723093803499.png