Google download file step

Problem:

After downloading a file from Google drive using google download, the file is being downloaded correctly, but there seems to be no way to actually access the data for later node HTTP operation with upload. It will always just return a json with the information of the data, such as mime type, name, etc., but no binary data that can be uploaded.

I tried putting the binary raw value but whatever I do it will always just return an object.

What is the error message (if any)?

This operation expects the node’s input data to contain a binary file ‘[object Object]’, but none was found [item 0]

and the node that I am using has some data, as it’s very possible to click on the View/Download buttons:

Please share your workflow

({
  "meta": {
    "instanceId": "9f9141bd1f96f0d754ec9dc7e5bb66bd8b8af4fc660f9a0aee31ed961d2dff2d"
  },
  "nodes": [
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.id }}",
          "mode": "id"
        },
        "options": {
          "binaryPropertyName": "drive_data"
        }
      },
      "id": "redacted for privacy",
      "name": "Download File",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1320,
        500
      ],
      "alwaysOutputData": false,
      "executeOnce": true,
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "redacted for privacy",
          "name": "redacted for privacy"
        }
      }
    },
    {
      "parameters": {
        "method": "PUT",
        "url": "=https://video.bunnycdn.com/library/redacted for privacy/videos/{{ $json[\"guid\"] }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/octet-stream"
            },
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "={{ $('Download File').item.binary }}",
        "options": {}
      },
      "id": "redacted for privacy",
      "name": "upload to bunny",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2260,
        500
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "redacted for privacy",
          "name": "Bunnycdn"
        }
      }
    }
  ],
  "connections": {},
  "pinData": {}
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.49.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu 20.04.4 LTS (Focal Fossa)

Welcome to the community @shayr :tada:
At the moment, you can’t access binary data that’s not directly from the previous node. So in order to make this work, you’ll have to make sure that the Google Download node is directly connected to the next node where you want to use the binary data to access it.

Hope that helps!

2 Likes

Well… there is an option to return the binary data once more and use it as a reference in the HTTP Node:

2 Likes

Hi aya, thanks for letting me know. I didn’t get the time to write about it, but that is actually how I “solved” it. I switched the order of things so that the upload would be immediately after the google download, which made it work. But I am happy to know it’s not something I did wrong or missed :slight_smile:

This looks promising for the future. As I mentioned to aya I ended up switching the order so that the upload is immediately after the download.

That being said, I do very much appreciate the time you took out to answer my question, and I am putting this in my automation brain-knowledge so I have it :pray:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.