Bug Description
The S3 node (the one for S3-compatible services, e.g. Minio or Digital Ocean Spaces — packages/nodes-base/nodes/S3/S3.node.ts), File > Upload with "Binary File" turned on, reads "Input Binary Field" with item index 0 inside the per-item loop. The upload binary branch calls this.getNodeParameter('binaryPropertyName', 0). The binary data lookup right below it uses the current index i (this.helpers.assertBinaryData(i, binaryPropertyName) and this.helpers.getBinaryDataBuffer(i, binaryPropertyName)).
If the field name is an expression that differs per item, every item uses the field name of the first item. The other parameters in this operation (bucketName, fileName, binaryData, additionalFields, tagsUi, fileContent) and the download operation already use the current item index.
To Reproduce
- Create two items. Item 1 has binary data on the field "data". Item 2 has binary data on the field "attachment". Each item has a "field" value in its JSON that names its binary field.
- Add an S3 node. Resource: File. Operation: Upload. Turn on "Binary File".
- Set "Input Binary Field" to {{ $json.field }}.
- Run the node.
- Item 2 looks up the field "data" instead of "attachment", so it fails with "no binary data property" or uploads the wrong binary when it also has a "data" field.
Expected behavior
The binary field name is read with the current item index. Item 2 uses "attachment".
Debug Info
Found by reading the source on master. Verified with a unit test that uses two items with different binary field names. The test fails without the fix.