Upload File with Baserow node

Hello!

I’m having an issue while trying to upload a file to a Baserow row.
So, after receiving an e-mail that I would like to import to Baserow, is expected to save the attachment from that e-mail. The problem is, I’m probably doing it wrong.

In Baserow node I select the correponding field that I want the file to be put on and the Field Value i’m putting {{$binary}} like I show below.


Can anyone explain me the correct way to treat files to baserow?
Thank you very much!

Hi @lgeraldes, welcome to the community :tada:

The Baserow node does not support uploading binary data I am afraid, but you could consider using the HTTP Request node for this. Check out this example from earlier this year: Baserow: Upload File with http-Node - #9 by UweG

Hello!

Thanks in advance,
I’m trying to replicate the UploadBinaryFile Baserow node used there but I’m not understanding very well. The fields now in the HTTP Request node are different to the ones used in your example.

I’ve tried to copy the cURL from API documentation, importing there and modify with my token but I’m still getting Bad Request and don’t know why.


So in most cases you should still be able to copy existing nodes from the forum (or other workflow templates) into your workflow and use them. That said, the new node can still handle uploads. Here’s a quick example built on [email protected] using the latest available nodes.

Table structure

My example Baserow table Demo consists of two columns Name (Single line text) and Attachments (File):

image

In the workflow I am using a bunch of identifiers, these are available through $yourBaserowUrl/api-docs:

Workflow

You can copy this workflow right into your n8n canvas so you don’t have to transfer individual field values.

Result

This should run fine once you update username, password, and hostname for your Baserow instance and update the IDs mentioned above:

After executing this workflow a new row has been inserted as expected:

image

image

Hope this helps @lgeraldes! Let me know if you run into any trouble with this.

Hello!
Thank you so much for that workflow.
So, after I’ve changed with my identifiers and credentials, I’m getting this error on the Login node:

{
	"status":
	"rejected",
	"reason":{
		"message":"write EPROTO 26670856:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:242: ",
		"name":"Error",
		"stack":"Error: write EPROTO 26670856:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:242: at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) at WriteWrap.callbackTrampoline (node:internal/async_hooks:130:17)",
		"code":	"EPROTO"
	}
}

Seems like something related with SSL, any idea what could be?

Nevermind… Just removed the ‘s’ from HTTPS and started working. :man_facepalming:
Thank you so much, I’ll try to implement it with my previous workflow, getting the file from an e-mail attachment.

1 Like

Awesome, glad to hear this works for you! As for using email attachments the basic idea should remain the same. Instead of the Download dummy file node you’d only need to make sure your email node returns a binary item and make sure the name matches when referencing it:

Very nice, worked perfectly for an e-mail received with a PDF attached.
However, I’m also trying to process an e-mail received that was forward as an attachment (outlook rule, it sends as “.MSG”).
When receiving this kind of e-mail, the attachment in n8n appears this way:
image
and when I try to view, the window opens in blank, when trying to Download it, nothing happens.
The flow works but the attachment in Baserow appears this way:
image

with the name “=” and only a few bytes in size:

Probably this is going a little bit offtopic but have any idea?

Hi @lgeraldes, I wonder if the = filename causes the problem here. What happens if you rename the file to something else? You can do so using a Code node for example:

Hello!
Just tried that. The node correctly renames the file (I’ve changed to .msg) but it’s the same thing, a few bytes in size and doesn’t open correctly in outlook.

UPADTE:
Just tried, send a normal e-mail with a .msg file attached and worked perfectly.
There’s something with the outlook function that is screwing this up.
I have a rule, when I receive an e-mail to a certain inbox with a certain subject, I forward that e-mail as attachment and that generates a .MSG file and forward to another inbox.
If I check that inbox, I can open that .MSG attachment without problem. It’s when running the n8n workflow and putting that attachment in Baserow that something goes wrong.

I have an If node to separate 2 kinds of received e-mails (if there’s “FW:” present in the subject) and is working perfectly just to separate 2 kinds of e-mails to different Tables in Baserow.
Here’s a picture of my actual workflow. I can share the entire workflow but need to remove the credentials, if you want to check that, I can do it.

Seeing you are using the IMAP node here, can you perhaps check whether the behaviour is different when using the actual Outlook node provided by n8n?

This will require some slight changes to your workflow (as the Outlook node is not a trigger node you’d need to use a Schedule trigger to fetch the unread messages every few minutes or so) but sounds like it might be worth a shot.

Unfortunately, I’m using the IMAP node to check an internal mail server (hMail). I’m only using Outlook to forward those e-mails to that internal mail account.
Nevertheless I’m going to try forward to an Outlook/365 account to check if the problem is related with that IMAP node.
If positive, maybe it’s considered a bug of the node itself?

Hello and happy new year!

So, I’ve tried to swap the IMAP node with Outlook node and could retrieve the attachment correctly, change it’s name to add “.eml” in the end and then, add as an attachment in a baserow line.
Can we assume there’s a bug somewhere in the IMAP node that can’t fetch the .eml correctly?

Hi @lgeraldes, that might well be though this behaviour might also be provider specific so could be hard to reproduce. Perhaps you can forward an email using which this can be tested to my Gmail address so I can further test this? I’ll DM you the email in a sec.

Thanks so much for sharing the example @lgeraldes! I was not able to reproduce your exact problem unfortunately, but could definitely get the Email Trigger (IMAP) node to struggle with the file.

The error I am getting on the current release [email protected] was “TypeError: Expected the input argument to be of type Uint8Array or Buffer or ArrayBuffer, got string”:

I shall add this to our engineering backlog for a closer look and fix. I am so sorry for the trouble :frowning:

Thank you!
It looks like it’s struggling only (as I’ve tested) with .eml (and probably .msg) files.
Passing PDFs, for example as attachment, works perfectly.

1 Like

Yep, it seems to affect all file types used by different Outlook versions for forwarding. I tried using the O365 web version and Outlook ended up sending an .rfc822 file resulting in the same error. Other attachment types were also working fine for me.

Exactly, IMAP node outputs this rfc822:
image

Hello @MutedJam!
Do you know if the engineering team already had a chance to check this out?
Sorry for bother again about this problem.

Best regards,
Luís