2024 Aug 08 4:04 AM - edited 2024 Aug 08 4:08 AM
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
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.
So I want to control the actual name of the ZIP file itself. But how ?
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 !
And here is the ZIP file returned
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.