How to upload an image from N8N to baserow?

I’m trying to send a mime type file from N8N to baserow, but I can’t, can someone help me?

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        180,
        40
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "image",
              "value": "base64"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        400,
        40
      ]
    },
    {
      "parameters": {
        "mode": "jsonToBinary",
        "convertAllData": false,
        "sourceKey": "image",
        "options": {
          "dataIsBase64": true,
          "mimeType": "image/png"
        }
      },
      "name": "Move Binary Data3",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1,
      "position": [
        600,
        40
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "databaseId": 28161,
        "rowId": "6",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldValue": "={{$node[\"Move Binary Data3\"].binary.data.mimeType}}"
            }
          ]
        }
      },
      "name": "Baserow",
      "type": "n8n-nodes-base.baserow",
      "typeVersion": 1,
      "position": [
        820,
        40
      ],
      "credentials": {
        "baserowApi": {
          "id": "18",
          "name": "Baserow admdiegolima"
        }
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Move Binary Data3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move Binary Data3": {
      "main": [
        [
          {
            "node": "Baserow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

can you do it by the native node or would you have to use http request?

Hey @admdiegolima, sorry for the late answer.

Baserow API doesn’t allow to upload a file and create/update a row at the same time. So if you want to add a file to a row, you have to upload it first with a HTTP POST using a basic n8n request node to the /api/user-files/upload-file/endpoint. As soon as the file is created, with the response content, you can reference it during the row creation.

Try to upload a file with the UI to see how it’s working. You’ll see something like that:

image

The first POST is the file being sent to the server then the response content is used to create a PATCH query to update the row with the new file. You also can also use an another POST to create a row instead of updating one. Alternatively if a file exists already and is referenced elsewhere you can use the same file informations for your row.

Does it help?

i have done step one of uploading the files to the user-files API.

Now can i reference that file and use it inside an expression field value of a normal Baserow create node ?

Yes you should be able to use it with the normal baserow create node. Use the name of the returned file.

Hi @jrmi … But after that…

How list al the files uploaded?

How erase these files?

If I got a total space occuped by the files on the server? How to exclude files? How Baserow manage it by itself?

How many time the file stay stored on the server?

All my questions is because I need to upload a file on a field file… And I didn’t do that yet :sob:

@joffcom could you please help out here?

Hey @hugo.lourenco,

Are you using Baserow Cloud or Self hosted?

Maybe this link will help: Question about where the files sent via the api