i guys i am new to node and n8n. i am using Google drive node (using download option ) to get a file and now I am trying to pas the binary file to next node
If you are writing your own node I would take a look at what other nodes are doing that upload files maybe the Mindee node as a starting point.
Below is how it fetches the binary data so the trick is to have an option that you can input the property name of the binary object so looking at the google output you have data. This would be referenced as inputItem[data] using the ibinarydata type and from there you can get your buffer and it should be all good.
const item = items[i].binary as IBinaryKeyData;
const binaryData = item[binaryPropertyName] as IBinaryData;
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
It looks like you are fairly close you are getting the property name as a string it should be a case of taking the above and tweaking for your code and you will be posting data.
@Jon thanks for helping me out now i am able to get the binary data i have check them in the logs .
yes you are right i am writing my custom node, now i am getting error “source.on is not a function”. here is my code.
It is hard to say what is happening there without seeing the full error message.
I would probably start by putting in some checks to make sure none of the options are undefined, If I was to take a guess I would say the issue is with the formData it could be something silly like files needs to be file