I’m trying to save all the attachments from a mail with the write binary file but I can’t manage to write other than the attachment_0 for all the items.
I’ve found this code: Split binary file data into individual items - n8n Documentation but I get this alert: Legacy items is only available in the ‘Run Once for All Items’ mode
what can I do to solve it? The proposed solution from the helper, change items for $input.item aslso gives me an error: ERROR: $input.item is not iterable [line 3, for item 0]
TypeError
Maybe it’s something quite easy but I can’t see it now
Thanks john - i carried on experimenting and yep, I can name them all “whateverthehellIlike”, with this:
whateverthehellIlike : item.binary[key],
So replacing that with a string should work, but if I remember rightly you can’t use a variable in the key definition in JS. Someone will correct me if I’m wrong!
For my purposes, just changing them all to be “attachment_0” worked, as I’d written the rest of the routine for single attachment emails using that property name throughout.