Uploading Images to Google Doc

Hi - I am trying to upload multiple images collected from a CognitoForm web form to Google Drive folder. When I run the flow, everything works except the files are coming in as documents instead of images. Thefiles are uploaded and are named correctly, but the documents contain the URL of the image file instead of uploading the actual image.
Any thoughts?

Can you share your workflow? Select all the nodes, copy them and then paste them here.

How are you extracting the images from CognitoForm? Are you using the HTTP request node? Are they coming via webhooks using the Webhook node?

Cognito Form sends a webhook with the data. I’m using Item Lists to split the attachments (image URLs) into separate items, then trying to upload those files to google Drive.

I’ve also tried multiple combinations of Read Binary and Write Binary nodes but can’t seem to get it to work, even after looking at the documentation.

Here’s the workflow:
{
“nodes”: [
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “3f038a4a-30d6-4e93-9df0-577cef9902da”,
“responseMode”: “lastNode”,
“responseData”: “allEntries”,
“options”: {}
},
“name”: “Webhook”,
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 1,
“position”: [
270,
470
],
“webhookId”: “3f038a4a-30d6-4e93-9df0-577cef9902da”
},
{
“parameters”: {
“fieldToSplitOut”: “body.UploadPhotosVideos”,
“include”: “selectedOtherFields”,
“fieldsToInclude”: {
“fields”: [
{
“fieldName”: “=body.Name.FirstAndLast”
}
]
},
“options”: {}
},
“name”: “Item Lists”,
“type”: “n8n-nodes-base.itemLists”,
“typeVersion”: 1,
“position”: [
470,
470
]
},
{
“parameters”: {
“authentication”: “oAuth2”,
“fileContent”: “={{$node[“Item Lists”].json[“body.UploadPhotosVideos”][“File”]}}”,
“name”: “={{$node[“Item Lists”].json[“body.Name.FirstAndLast”]}}_{{$node[“Item Lists”].json[“body.UploadPhotosVideos”][“Name”]}}”,
“resolveData”: true,
“parents”: [
“1XC2aZ2YWDO5xd1kfDj7iM9bNbHESdOVOQu6qIVDlThx2huYIFqJ4Tvajd00Q4UEu_hAkukoL”
],
“options”: {
“appPropertiesUi”: {
“appPropertyValues”: []
}
}
},
“name”: “Google Drive”,
“type”: “n8n-nodes-base.googleDrive”,
“typeVersion”: 1,
“position”: [
650,
470
],
“credentials”: {
“googleDriveOAuth2Api”: “Google Drive account”
}
}
],
“connections”: {
“Webhook”: {
“main”: [
[
{
“node”: “Item Lists”,
“type”: “main”,
“index”: 0
}
]
]
},
“Item Lists”: {
“main”: [
[
{
“node”: “Google Drive”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}

Got it to work!
{
“nodes”: [
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “3f038a4a-30d6-4e93-9df0-577cef9902da”,
“responseMode”: “lastNode”,
“responseData”: “allEntries”,
“options”: {}
},
“name”: “Webhook”,
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 1,
“position”: [
270,
470
],
“webhookId”: “3f038a4a-30d6-4e93-9df0-577cef9902da”
},
{
“parameters”: {
“fieldToSplitOut”: “body.UploadPhotosVideos”,
“include”: “selectedOtherFields”,
“fieldsToInclude”: {
“fields”: [
{
“fieldName”: “=body.Name.FirstAndLast”
}
]
},
“options”: {}
},
“name”: “Item Lists”,
“type”: “n8n-nodes-base.itemLists”,
“typeVersion”: 1,
“position”: [
470,
470
]
},
{
“parameters”: {
“url”: “={{$node[“Item Lists”].json[“body.UploadPhotosVideos”][“File”]}}”,
“responseFormat”: “file”,
“dataPropertyName”: “imagefile”,
“options”: {}
},
“name”: “HTTP Request”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 1,
“position”: [
630,
470
]
},
{
“parameters”: {
“authentication”: “oAuth2”,
“binaryData”: true,
“binaryPropertyName”: “imagefile”,
“name”: “={{$node[“Item Lists”].json[“body.Name.FirstAndLast”]}}_{{$node[“Item Lists”].json[“body.UploadPhotosVideos”][“Name”]}}”,
“resolveData”: true,
“parents”: [
“1XC2aZ2YWDO5xd1kfDj7iM9bNbHESdOVOQu6qIVDlThx2huYIFqJ4Tvajd00Q4UEu_hAkukoL”
],
“options”: {
“appPropertiesUi”: {
“appPropertyValues”: []
}
}
},
“name”: “Google Drive”,
“type”: “n8n-nodes-base.googleDrive”,
“typeVersion”: 1,
“position”: [
860,
470
],
“credentials”: {
“googleDriveOAuth2Api”: “Google Drive account”
}
}
],
“connections”: {
“Webhook”: {
“main”: [
[
{
“node”: “Item Lists”,
“type”: “main”,
“index”: 0
}
]
]
},
“Item Lists”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request”: {
“main”: [
[
{
“node”: “Google Drive”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}